Search code examples
javascriptjqueryperformanceload

using jQuery (put at the bottom of the page) on specific page


Because of performance purposes I put loading of jQuery scripts at the bottom of the page (just before the closing body tag).

My question is how to enable page specific scripts? I don't want to put everything inside $(document).ready method (again because of performance purposes).

Update: I'm using a template system so I put jQuery loading in the template. That way jQuery calls don't get recognized even if I put them at the end of a specific page because jQuery is not loaded at that point.


Solution

  • This allows you to call jQuery plugin methods in the body and load jQuery plugin on to bottom of the page headjs