开发者

Javascript : problem in html page rendering

when i am rendering a page I have a confirm button that pops up before the page is fully rendered . now if i delay in choosing an option from the confirm box my page is left half rendered and if i select an option from the confirm box quickly the page is fully rendered. Why is this ha开发者_C百科ppening?


Because browsers read web page from top to bottom and execute javascript on the way. You should use < body onload="yourfunction()" > to display your confirm box after page loaded completely. Or you can use jquery .ready function:

http://api.jquery.com/ready/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜