Search code examples
htmlhead

jquery mobile call the scripts not in the head


I'm building a jquery mobile site and I'm have some problem with javascript.if the script

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />

<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>

<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>

would be put at end of the footer, would be a problem for the site? I mean the script MUST be inserted into the head?


Solution

  • It is generally considered better practice to put javascript at the end of the page. The reason for this is if any of your elements are altered by the javascript or you have a large amount of elements that get the same JS operations performed on them then they will load slowly if the javascript is in the header. This should apply regardless of the platform you are deploying it for.