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? Or should I do something completely different?
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$(document).ready(function(){
var qString = '';
$('#execute').click(function(){
qString = $('#query-string').val();
console.log(qString);
$.post('test.jsp',qString);
});
});
</script>
</head>
<body>
<section>
<label for="query-string">Enter your query here!</label>
<input type="text" id="query-string">
<button id="execute">Execute</button>
</section>
</body>
</html>