I have a shopping cart, when I click the remove button, the page refreshes and removes the product….I then want it to redirect to a url after 5 seconds…so on the button in the hyperlink tag <a></a> I put in a onclick=”check();”
here is the script:
[code]<script type=”text/javascript”>
function go(){
window.location(“http://www.yahoo.com”);
}
function check(){
setTimeout(go(), 5000);
}
</script>
when I put alert messages in the script I wrote it goes reaches each function, but doesn’t redirect the browser and doesn’t wait 5 seconds after clicking the remove button, I used yahoo just for testing purposes of course…
[B]help a newbie out…what did I do wrong, why is nothing happening?
and putting the go() in “go()” in the setTimeout causes it to never even reach the function check when I put in alert messages…