0

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!

2
  • 1
    Try something first..... Commented Apr 22, 2013 at 17:25
  • This is what JSON is for... Commented Apr 22, 2013 at 18:14

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.