place $(document).ready(function() in external js

place $(document).ready(function() in external js

If i have my code inline on the html it functions correctly:

$(document).ready(function(){

      my code

});

if I place the code above in an external js file it doesn't work. 

How do you exicude the code from an external file.