Header is loaded at the end |
In just about every case, it's best to place all your script references at the end of the page, just before </body>.
If you are unable to do so due to templating issues and whatnot, decorate your script tags with the defer attribute so that the browser knows to download your scripts after the HTML has been downloaded: <script src="my.js" type="text/javascript" defer="defer"></script> Edge cases There are some edge cases, however, where you may experience page flickering or other artifacts during page load which can usually be solved by simply placing your jQuery script references in the <head> tag without the defer attribute. These cases include jQuery UI and other addons such as jCarousel or Treeview which modify the DOM as part of their functionality. |
Messages In This Thread |
Header is loaded at the end - by Datenshi - 10-30-2018, 08:45 AM
RE: Header is loaded at the end - by dave friend - 10-30-2018, 10:51 AM
RE: Header is loaded at the end - by php_rocs - 10-30-2018, 05:30 PM
RE: Header is loaded at the end - by Pertti - 10-31-2018, 02:48 AM
RE: Header is loaded at the end - by InsiteFX - 10-31-2018, 03:07 AM
RE: Header is loaded at the end - by Datenshi - 10-31-2018, 07:54 PM
RE: Header is loaded at the end - by garimapatil - 02-06-2019, 12:11 AM
|