title: Page Redirect after X seconds wait using JavaScript
body: <p>I need to redirect to specific url after 5 seconds after putting an error message. First i have used Javascript as below.</p>
  
  <pre><code>document.ready(window.setTimeout(location.href = "https://www.google.co.in",5000));
  </code></pre>
  
  <p>But it is not waiting for 5 seconds. Than I searched the issue in google than come to know that "document.ready()" is invoked when document is loaded at DOM, not at web browser.</p>
  
  <p>Than i have used window.load() function of jQuery but still i am not getting what i want.</p>
  
  <pre><code>$(window).load(function() {
                 window.setTimeout(window.location.href = "https://www.google.co.in",5000);
              });
  </code></pre>
  
  <p>Can anyone please let me know how exactly i need to do to wait for 5 seconds.</p>