title: How to redirect to another jsp page without loading the current page?
body: <p>I am using a script which runs in onload event.</p>
  
  <p>Template.html</p>
  
  <p>In this html file, headers, footers and some iframe elements are used.</p>
  
  <pre><code> &lt;script&gt;
  function callbeforeload()
  {
      if(condition)
      {
       //success
      }
      else
      {
      window.location("exception.jsp");
      }
  }
      &lt;/script&gt;
  
  &lt;body onload="callbeforeload();"&gt;
  </code></pre>
  
  <p>If I use window.location, it is redirecting to another jsp page. 
  My question is template.html should not load the entire page. It should first check this script and then proceed to other function.
  Now it loads the entire page (normally iframe in my case) and then comes to this script.
   Is there any alternate way to achieve this?</p>