views:

39

answers:

2

How to use JQuery to call a servlet which I usually call like this http://localhost:8080?a=1&b=2&c=3. I particularly want to find out how to pass URL params.

+1  A: 

Earlier today I wrote up a detailed explanation of using the jquery $.post() to interact with php. The jquery side will be exactly the same for a servlet; only the address will differ.

If you'd rather use a get request, or return data that is not in the format of either JSON or a string, you can get info about the different methods possible from the jQuery API.

JGB146
+1  A: 
$.ajax({
  url: 'http://localhost:8080',
  data: {a: 1, b: 2, c: 3},
  success: function(response) {
  }
});
Bytecode Ninja