开发者

Jquery animation plugins HEAD versus BODY

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜