horseatingweeds Posted August 18, 2007 Share Posted August 18, 2007 I'm having trouble getting this function to work. I'm trying to make this page, after opening and running a php mail(), to forward to another page. <script language="javascript" type="text/javascript"> function forward() { var localTime = new Date(); if (localTime == (localTime + 2)) { window.location = window.location.history.go(-2); } } </script> <body onload="forward()"> Quote Link to comment Share on other sites More sharing options...
php_tom Posted August 18, 2007 Share Posted August 18, 2007 First of all you can't add 2 to a date object... localTime + 2 And even if you tested the hour or something, it still wouldn't work, because [i != (i + 2)] [ever ] Please explain what exactly you're trying to do. Quote Link to comment Share on other sites More sharing options...
horseatingweeds Posted August 18, 2007 Author Share Posted August 18, 2007 I've figured it out: <body onload="setTimeout('history.go(-2);', 2000)"> simple enough. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.