...

View Full Version : onreadystatechange



dallen24
07-07-2002, 06:48 AM
Hi. I've created a google like search over my web site. Been trying to improve this search and need some help.

This is what I do. From one frame, I'll load another frame with either a text or html file. Once loaded, I perform a text search. If found, I'll scroll the text into view.

Got this to work in IE using parent.frames[1].document.readyState == "complete" in a setTimeout loop. I realize it's inefficient. I'ved tried parent.frames[1].document.onreadystatechange = "alert('fire')", but doesn't seem to fire. Does anyone have a working example of onreadystatechange?

nolachrymose
07-07-2002, 02:17 PM
parent.frames[1].document.onreadystatechange=tmp;
function tmp() {
alert(var rs=parent.frames[1].document.readyState);

if(rs==4) {
//statements to execute when loaded
}
}

Hope that helps!

Happy coding! :)

dallen24
07-08-2002, 03:54 AM
Originally posted by nolachrymose

parent.frames[1].document.onreadystatechange=tmp;
function tmp() {
alert(var rs=parent.frames[1].document.readyState);

if(rs==4) {
//statements to execute when loaded
}
}

Hope that helps!

Happy coding! :)

I've tried it with my IE 5.5. Doesn't seem to want to fire. What am I doing wrong? Do you know of any web site with a working example of onreadystatechange?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum