javascript - document.ready inside body tag - Stack Overflow

I have a web app that has a universal HTML header include, so I'd like to put page-specific script

I have a web app that has a universal HTML header include, so I'd like to put page-specific scripts in each page instead of having it load for everything. I tried putting document.ready() near the end of the <body> of a page and it seems to be working fine. Are there any potential hazards to putting it there instead of inside the <head>?

I have a web app that has a universal HTML header include, so I'd like to put page-specific scripts in each page instead of having it load for everything. I tried putting document.ready() near the end of the <body> of a page and it seems to be working fine. Are there any potential hazards to putting it there instead of inside the <head>?

Share Improve this question edited Feb 3, 2009 at 23:09 Eric Wendelin 44.4k9 gold badges72 silver badges94 bronze badges asked Feb 3, 2009 at 23:05 MatthewMatthew 7,7357 gold badges41 silver badges39 bronze badges 1
  • Refer this thread stackoverflow./questions/17659121/… – Uday Vaswani Commented Mar 23, 2016 at 2:02
Add a ment  | 

2 Answers 2

Reset to default 8

Yahoo remends putting all scripts at the end of your document for performance - http://developer.yahoo./performance/rules.html

None. Just make sure everything is loaded in the proper order.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743761911a4502787.html

相关推荐

  • javascript - document.ready inside body tag - Stack Overflow

    I have a web app that has a universal HTML header include, so I'd like to put page-specific script

    6天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信