I'm struggling to figure out the correct syntax to pass a JavaScript variable named "textVal" to a jsp file. Here is my code snippet:
function show(textVal){
AJAX.onreadystatechange = handler;
AJAX.open("POST","service.jsp",true);
AJAX.setRequestHeader("Content-type","application/x-www-form-urlencoded");
AJAX.send("fname='+textVal+'");
};
Can someone help me with passing the textVal variable to service.jsp?