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
Post a Comment