On many pages I include the validation plugin, always include the jquery source link, generally include the jquery UI links and sometimes it looks like my header or footer is packed with the stuff.
To get开发者_运维问答 around that I want to include all Jquery links sources from one file, however my question is, if I do that is there any speed degradation or performance on a page to include Jquery ui, validation plugin links and even to other plugins such as Markitup on pages that do not use or need them?
The reason for this is for the most part I use common headers and footers and find myself having to make special headers/footers etc for certain pages such as internal forms etc.
This is for personal sites, not commercial so speed isnt the highest concern
There shouldn't be any performance hit caused by including all of the javascript at once on every page. The only thing that might happen is your initial load time will be increased ever so slightly (though I believe most browsers cache external .js
files anyway so I'm not sure that would even increase).
EDIT: You might also consider having a flag in your standard header that tells it whether to output the javascript or not.
精彩评论