Unique setTimeout situation.

Discussion in 'JavaScript' started by Jen-, Nov 18, 2006.

  1. #1
    Hello, I have a setTimout in one of my pages for one reason and another that looks like this. <BODY onLoad=window.setTimeout("location.href='http://www.website.com/test2.php'",5000)>

    It makes the page reload every few seconds.

    Thing is, I am calling on this page from another page with a php include. For sake of example I'll name the page with the include in it "test.php"

    <?php
    include 'test2.php';
    ?>

    I need the setTimeout to work in the page it is in "test2", not in the new page with the php include "test.php". A funny thing happens. When test.php is showing in the browser, it changes to page "test2" without me touching a thing.

    I thinks its because of the body onload command of the timeout function is named "window.setTimeout." Any way to change "window.setTimeout" to something else? It doesn't seem to be honoring the location address I have in the location.href.

    I have big reasons on why I need to set it up this way, just don't have the time to type up a huge page to explain it.
     
    Jen-, Nov 18, 2006 IP