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/
精彩评论