Is it better (in any way) to use jQuery’s getScript to load the external JS than linking the javascripts manually in the html?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the javascript file you want to load is somewhat optional, e.g. for a specific browser or maybe geolocation, i’d use
getScript; otherwise I’d see no need to push the ‘include’ further down in the page loading process than a plain htmlscript.If you are concerned about performance, i would guess that the ‘plain-method’ is faster, but I haven’t tested it. For web page load time performance tuning, there is a nice tool, called yslow, which is a firebug extension.