JQuery Redirect to URL after specified time
You could use the setTimeout()
function:
// Your delay in millisecondsvar delay = 1000; setTimeout(function(){ window.location = URL; }, delay);
You don't really need jQuery for this. You could do it with plain javascript using the setTimeout method:
// redirect to google after 5 secondswindow.setTimeout(function() { window.location.href = 'http://www.google.com';}, 5000);
$(document).ready(function() { window.setInterval(function() { var timeLeft = $("#timeLeft").html(); if(eval(timeLeft) == 0) { window.location= ("http://www.technicalkeeda.com"); } else { $("#timeLeft").html(eval(timeLeft)- eval(1)); } }, 1000);});