title: send parameter from js file to jsp file with ajax
body: <p>Here is my js file where my goal is to send variable va to jsp file and output it. The problem I can't find the bug.
    </p>
  
  <pre><code> $(function(){
      $("td").click(function(){
  
          var date = $(this).html();
          var message = prompt(year+"year "+month+"month "+ date+"day","null!");
          this.append(message);   
          var variable = "mememem";
          var sendData = new XMLHttpRequest();
          sendData.onreadystatechange = function() {
              if (this.readyState == 4 &amp;&amp; this.status == 200) {
                alert("connected to server");
              }
            };
  
          sendData.open('GET','dataFile.jsp?na='+variable,true);
          sendData.send(null);
          window.location = "dataFile.jsp"; 
  
      })
  });
  </code></pre>
  
  <p>///////////////////////////javascript file//////////////////////</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=EUC-KR"
      pageEncoding="EUC-KR"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=EUC-KR"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;%
  String name = request.getParameter("na");
  
  out.print(name);
  %&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>///////////////////jsp file</p>