javascript - How to redirect to another jsp page without loading the current page? -


i using script runs in onload event.

template.html

in html file, headers, footers , iframe elements used.

 <script> function callbeforeload() {     if(condition)     {      //success     }     else     {     window.location("exception.jsp");     } }     </script>  <body onload="callbeforeload();"> 

if use window.location, redirecting jsp page. question template.html should not load entire page. should first check script , proceed other function. loads entire page (normally iframe in case) , comes script. there alternate way achieve this?

try writing script tag first element in head tag. not wrap code inside function directly executed.

<head>  <script>   if(condition)   {     //success   }   else   {     window.location("exception.jsp");   } </script> 


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -