title: JS - Redirect and return to home page
body: <p>I have an issue, I want to create a script in Page1 and after X seconds redirect to Page2, and inside Page2 return to Page1, and make it is not difficult, and here is my issue, after return from Page 2, I want to redirect to Page3, and return to Page1, and when I reurn from Page3 I want to redirect to Page4, every redirect with X seconds.
  I know I can redirect with meta tag </p>
  
  <pre><code>&lt;meta http-equiv="refresh" content="X; 
  URL=Page2.com"&gt;
  </code></pre>
  
  <p>and the same tag for Page2 to return to Page1, but I need to do is something like this in Page1</p>
  
  <pre><code>&lt;!-- First Redirect --&gt;
  &lt;meta http-equiv="refresh" content="x; URL=Page2.com"&gt;
  &lt;!-- Second Redirect --&gt;
  &lt;meta http-equiv="refresh" content="x+x; URL=Page3.com"&gt;
  &lt;!-- Third Redirect --&gt;
  &lt;meta http-equiv="refresh" content="x+x+x; URL=Page4.com"&gt;
  &lt;!-- Fouth Redirect --&gt;
  &lt;meta http-equiv="refresh" content="x+x+x+x; URL=Page5.com"&gt;
  </code></pre>
  
  <p>There is someway to that in script? because it didn't work, always redirect me to Page1.com.</p>
  
  <p>Thanks for helping me!</p>