title: Why is my code failing to pass parameters from JavaScript to JSP using XMLHttpRequest?
body: <p>I am trying to write JavaScript code which, on a mouse click event, sends some parameter (id) to the server-side JSP code. The JSP code then returns a string to the JavaScript.</p>
  
  <p>...and the response text will be a string returned from JSP specified in <code>out.println(substring);</code>.</p>
  
  <p>This code is not working. Sorry if I am doing something silly; I am new to coding for the web.</p>