[Javascript] Help with forwarding to another page

Michael J. Mahony lists at mahonyconsulting.com
Thu Mar 13 21:50:25 CST 2003


I'm doing something very simple but I can't seem to get it to work.  I
want to load a page that has a graphic and a button that says "SPIN" 
(the
graphic is a spinning wheel).  When the user clicks "SPIN" my script
replaces the static graphic with an animated graphic that was chosen by
the ASP script as the page loaded.  When the graphic is done I want to
push the user to a page that tells them what they won.  Here is the 
script
I'm using:

<script LANGUAGE="javascript">
<!--
function spinWheel()
{
document.wheel.cmdSpin.disabled = true;
document["user1"].src="<%=sPicture%>";
window.setTimeout("window.top.location.href='spin_result.asp'", 3000); 
}
//--> </script>

If I include the setTimeout line the button never works and the
graphic never changes.  If I don't include the setTimeout I have no
way to get the user to the next page.

How can I accomplish this seemingly simple task?

Thanks,

Mike




More information about the Javascript mailing list