peterinwa
04-05-2003, 08:53 PM
I just spent 6 hours isolating the most obscure bug. The funny thing was that putting alert messages in the code to help find it (see how far I got through the code before it crashed) stopped it from occurring.
I'm using frames, and I use a frame called "create" to run things. "create" maintains variables and re-creates the page the users see, "image," as necessary to change the image they see.
To re-create it I call the function makeImage().
At the very end of makeImage(), after the document.write that actually re-creates the page, I do a focus() to place the cursor where I want it on the newly re-created page. The program runs without the focus(), but with it somewhat inconsistently IE crashes with the message "performed an illegal operation." Can't have that!
It seems -- just guessing here -- that when it crashes it might be trying to focus() on a page that isn't fully re-created yet. Doesn't exist yet. This could happen as the page can take some time to re-create. (This would explain why placing an alert message before the focus() stopped the problem from occuring... giving it more time.)
I need something like onDocumentDoneWriting.focus().
Thanks for any ideas, Peter
function makeImage(){
c=...
c+="</td></tr></table></center></body></html>";
parent.image.document.write(c);
parent.image.document.close();
parent.image.document.f1.search.focus();
}
I'm using frames, and I use a frame called "create" to run things. "create" maintains variables and re-creates the page the users see, "image," as necessary to change the image they see.
To re-create it I call the function makeImage().
At the very end of makeImage(), after the document.write that actually re-creates the page, I do a focus() to place the cursor where I want it on the newly re-created page. The program runs without the focus(), but with it somewhat inconsistently IE crashes with the message "performed an illegal operation." Can't have that!
It seems -- just guessing here -- that when it crashes it might be trying to focus() on a page that isn't fully re-created yet. Doesn't exist yet. This could happen as the page can take some time to re-create. (This would explain why placing an alert message before the focus() stopped the problem from occuring... giving it more time.)
I need something like onDocumentDoneWriting.focus().
Thanks for any ideas, Peter
function makeImage(){
c=...
c+="</td></tr></table></center></body></html>";
parent.image.document.write(c);
parent.image.document.close();
parent.image.document.f1.search.focus();
}