I have an html page with 2 external javascript files
one that is global
<script src=".../js/global.js" type="text/javascript"></script>
and one that is local
<script src="js/local.js" type="text/javascript"></script>
Obviously, I use jQuery
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script>
So far, so good.
In both external javascript files, I insert my jQuery code inside the following piece of code
$(document).ready(function() {
// code goes here...
});
I've tried removing that piece of code in the local external javascript file since I've already have it on my global file. But it doesn't work. So, my question is do i absolutely need to start both external java script files with that piece of code? How do i make it so i only have it on my global file?
Thanks