I want to go to the previous page after a 2 second delay using jQuery. I thought maybe I could do it this way but I think 'm using this in the wrong context. Code doesn't do anything worthwhile.
function goBack() {
$(this).delay(3000, function(){
history.back();}
return false;
}
The second argument to delay()
is a queueName
, not a function to run after the delay. Use setTimeout
instead:
setTimeout(function(){history.back();}, 3000);
JS Code
setTimeout('history.go(-1)', 3000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With