开发者

Call javascript on end loading page

开发者 https://www.devze.com 2023-02-16 12:53 出处:网络
How to call javascript function at the end of loading page ? I a开发者_Go百科ddat the end of page, but is there any other way ?Use onloadIf you\'re using jquery, you can use ready()Adding it to the en

How to call javascript function at the end of loading page ? I a开发者_Go百科dd at the end of page, but is there any other way ?


Use onload


If you're using jquery, you can use ready()


Adding it to the end is actually wrong because of the way it may behave with different browsers.

You should add it to the onload event of the body tag.

e.g

<body onload="DoAfterPageLoad()">
0

精彩评论

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