title: Javascript not working!! cannot redirect to java page
body: <pre><code>&lt;script type="text/javascript"&gt;
          function editRecord(id) {
              url="EditRecord";
              window.location.href = "http://localhost:8084/BookStore/" +url+ "?id" + id;
              return false;
          }
  &lt;/script&gt;
  
  
  
  &lt;tr&gt;
                      &lt;% String s = (String) itr.next();%&gt;
                      &lt;td&gt; &lt;%=s%&gt; &lt;/td&gt;
                      &lt;td&gt; &lt;%=itr.next()%&gt; &lt;/td&gt;
                      &lt;td&gt; &lt;%=itr.next()%&gt; &lt;/td&gt;
                      &lt;td&gt; &lt;%=itr.next()%&gt; &lt;/td&gt;
                      &lt;td&gt; &lt;%=itr.next()%&gt; &lt;/td&gt;
                      &lt;td&gt;&lt;input class="dr-input" type="submit" value="Edit" name="edit" onclick="editRecord(&lt;%=s%&gt;)"&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;input class="dr-input" type="submit" value="Delete" name="delete" onclick="deleteRecord(&lt;%=s%&gt;);"&gt;&lt;/td&gt;
                          &lt;% }%&gt;
                  &lt;/tr&gt; 
  </code></pre>
  
  <p>what I want is, when i click the button(Edit) it should redirect to a servlet page(EditRecord.java).
  The Above code is in jsp. the Button doesnt redirect to the specified page. what's wrong with the code?
  Is there any other way to deal with this?</p>