Delay automatic url redirect with jquery?
问题 I need a transition page that will display for 2 seconds before automatically redirecting to the home page. How do I do this? I can't seem to get delay to work for me. 回答1: You can just use setTimeout() directly, like this: setTimeout(function() { window.location.href = "/NewPage.aspx"; }, 2000); 回答2: setTimeout(function(){ window.location = "/NewPage.aspx"; }, 2000); 回答3: You could use jQuery Timer. Here is the code (also found in this article): // This will hold our timer var myTimer = {};