I have an application that is basically a viewer for book content in HTML form. A user can display a page of the book and use "viewer" next / previous buttons to go to the next / previous page in the book. The viewer itself is HTML and uses dojo / ajax to support its features. Sounds simple enough.
The problem...I've found that if certain pages are loaded and the user clicks the Next button right away, IE 7.0 just crashes.
Each page of the book is an HTML snippet (e.g., <div> tag that contains the content of that page).
The viewer has a <div id="pageContainer"> tag that acts as a container for the content.
When a user requests a new page be displayed, dojo is used to fetch the page (the URL of the page is known) and the result is added to the DOM. For example,
var pageContainer = document.getElementById("pageContainer"); pageContainer.innerHTML = content_returned_by_dojo_call;
The pages with which we see this problem are bigger than others.
Help! How can I tell when IE is ready to continue? Or am I on the wrong track???
Thanks! Kelly [ June 02, 2008: Message edited by: Bear Bibeault ]
Is the problem that you need an Ajax call to complete on page load before the page is ready to use by the user? Or that onload is not being called until after the user starts clicking around and causing the issues?
For the former, I'd re-jigger the page to not require Ajax on page load using server-side tools (JSP et al). Or, if that's not possible, hide (or disable) the body content until it is ready for interaction.
Same with onload. The problem with onload is that it waits around for images and other stuff to load. If that takes a while, the user might be able to get in there before you've had a chance to finish setting up the page.
jQuery adds a "document ready" handler that you can use to set up the page after the DOM is rendered, but before images are loaded. I don't know if Dojo has a similar concept.
So, at the time the user chooses to display content, I would not expect an onload() event to fire because the entire document is not being loaded. My problem is occurring after the entire document has been loaded and after a user clicks some button which causes innerHTML to be set.