validation of code

validation of code

I am trying to pass a string to a jsp file, and then I hope the jsp file will do something with the string. I don't know jsp though. I just want to make sure that my logic is correct. My code "works", but I want to make sure of what it does.  I think I am posting the val of the string to browser's memory and calling the test.jsp file. Is that what is happening? 

  1. <!DOCTYPE html>

  2. <html>
  3. <head>
  4.     <title>Page Title</title>
  5.     <script src="http://code.jquery.com/jquery-latest.min.js"></script>
  6.     <script>
  7.         $(document).ready(function(){
  8.             var qString = '';
  9.             $('#execute').click(function(){
  10.             qString = $('#query-string').val();
  11.             console.log(qString);
  12.             $.post('test.jsp',qString);
  13.             });
  14.         });
  15.         
  16.         
  17.     </script>
  18.     
  19. </head>

  20. <body>
  21.     <section>
  22.         <label for="query-string">Enter your query here!</label>
  23.         <input type="text" id="query-string">
  24.             <button id="execute">Execute</button> 
  25.         
  26.     </section>



  27. </body>
  28. </html>
  29.