with many things we do we reference external jquery plugins in the head and do things in the head like $(document).ready ..... We'll we are using ONE CMS that does link Jquery proper in the head itself, but we can't put anything in the head ourselves and just in the the body.
My question with regards to javascript animation and other issues what are the side effects/risks and gotchas of doing loading jquery plugin开发者_如何学编程s and code inside the body and whether $(document).ready can be trusted there
Yes you can put your javascript code at any part of the page but as a convention it should go in head
tags but Yahoo performance article and SEO insist that javascript code should go at the bottom of the page.
So you should/can put your javascript code at the end of the page.
It is best practice to include javascript at the bottom of your document:
http://developer.yahoo.com/performance/rules.html#js_bottom
精彩评论