title: How to send data from javascript to servlet inside url
body: <p>this is my javascript code </p>
  
  <pre><code>$('a').click(function() {
      ty = $(this).index();
      de = document.getElementsByTagName('klw')[ty].innerHTML;
      alert("this is " + de);
  });
  </code></pre>
  
  <p>want to send "de" data from $('a') to the other method that is </p>
  
  <pre><code>function jill() {
      alert("hi" + de);
  
      document.location.href = "openmessage";
  };
  </code></pre>
  
  <p><code>openmessage</code> is the name of servlet. And from here to the servlet and how to print it on the servlet</p>