Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

here's how the array looks like:

A[0] = { time, data[lon, lat], type }
...
A[n]

I want to send A to a servlet using jquery ajax and be able to have the same object on the servlet so I can access values like A[0].data[0].lat

I am wondering what is the best approach, I'm not a programmer and I've been searching and trying for a few days!

share|improve this question
1  
Try something first..... – Mohammad Adil Apr 22 '13 at 17:25
    
This is what JSON is for... – jahroy Apr 22 '13 at 18:14

1 Answer 1

I recommend using JSON: On the server side, use one of the JSON libraries listed on http://www.json.org.

On the client-side (jQuery), you'd want something like this:

var myData = JSON.stringify(A);
$.post('myurl.html', myData, function(data) {
    //success function
});

You could also use $.get if that works for you

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.