scriptlet - Scripplets not working inside a javascript function -


friends writing code on jsp have use button call class , use method.however when tried same received unexpected output.i tried search reason , came across various related questions still struck don want use el or jstl.so when calling javascript function on button click working put java code lets response.sendredirect("/abc.jsp") page getting redirected before click button.please struck , not able solution.below working fine.but when add java code.it performed without click event.

</head> <body>     <button id="dounzip" type="submit" name="unzip">unzip</button>     <script>      document.getelementbyid('dounzip').onclick=function (){       alert("welocome");   };      </script>  </body> 

now below not working

<body>     <button id="dounzip" type="submit" name="unzip">unzip</button>   <script>         document.getelementbyid('dounzip').onclick=function (){       <%        response.sendredirect("/index.jsp");       %>    };    </script> </body> 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -