jsp - Javascript not working!! cannot redirect to java page -


<script type="text/javascript">         function editrecord(id) {             url="editrecord";             window.location.href = "http://localhost:8084/bookstore/" +url+ "?id" + id;             return false;         } </script>    <tr>                     <% string s = (string) itr.next();%>                     <td> <%=s%> </td>                     <td> <%=itr.next()%> </td>                     <td> <%=itr.next()%> </td>                     <td> <%=itr.next()%> </td>                     <td> <%=itr.next()%> </td>                     <td><input class="dr-input" type="submit" value="edit" name="edit" onclick="editrecord(<%=s%>)"></td>                     <td><input class="dr-input" type="submit" value="delete" name="delete" onclick="deleterecord(<%=s%>);"></td>                         <% }%>                 </tr>  

what want is, when click button(edit) should redirect servlet page(editrecord.java). above code in jsp. button doesnt redirect specified page. what's wrong code? there other way deal this?


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -