how to check if page is already loaded?

Discussion in 'JavaScript' started by phpworker, Jul 31, 2005.

  1. #1
    Hi there! this is my situation:
    1. open window with specified URL that points to a website.
    2. the website is redirected to another URL by script of that website.
    3. get the URL the website was redirected to.

    The problem is between points 2 and 3. How javascript might recognize if website is already reloaded, so it can get the new URL of it?

    I tried to do something like that:
    while (!newwindow.location)
    { }
    newurl=newwindow.location.href;

    but it returns address of blank page. Also tried to use:

    <META HTTP-EQUIV="refresh" CONTENT="5; URL='+url+'">

    in new window - no reaction.

    Any answer would be very appreciated, thank you.
     
    phpworker, Jul 31, 2005 IP
  2. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #2
    When the page is fully loaded, its onload handler gets called. That's your clue.
     
    J.D., Aug 1, 2005 IP