Wednesday, 7 August 2013

How to pass data to AJAX call

How to pass data to AJAX call

Can anyone tell me how to pass data to the jsp making the AJAX call ? This
is what I am trying:
Here is my AJAX call:
$.get("gridedit.jsp", { before: "row", time: "2pm" })
.done(function(data) {
alert("Data Loaded: " + data);
});
here is my gridedit.jsp
<% String b=request.getParameter("before");
if(b.equalsIgnoreCase("row"))
{
System.out.println("ROW ROW ROW your boat");
out.println("bummer");
} %>
i want to store the value returned from gridedit.jsp into a javascript
variable. How should I do this ?
please help
thanks

No comments:

Post a Comment