title: infinite loop of alert messages
body: <p>I want to display alert message and then refresh the page.</p>
  
  <p>But it take infinite loop of alert messages.</p>
  
  <pre><code>   if(isValid){
        alert("alert some text");
        document.location.reload(true);
     }
     else {
         .............
     }
  </code></pre>
  
  <p>How can I do that with out infinite loop</p>