Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onreadystatechange

    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?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    338
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    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!

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by nolachrymose
    Code:
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •