1

I am receiving data as such from URL.The URL is

data=%5B1%2C2%2C3%2C4%2C0%5D

which decodes to [1,2,3,4,0].

I have parsed this data using the below snippet

var queryObj = querystring.parse( theUrl.query );

But I think its not an array.How do I convert it into array.I have used toArray()method but in vain.Thankx in advance.

3
  • You are passing array with url? Commented Nov 6, 2012 at 6:22
  • yeah through AJAX.as data:{data:data} Commented Nov 6, 2012 at 6:24
  • 1
    Why don't you use POST method instead of GET? Commented Nov 6, 2012 at 6:25

1 Answer 1

2

Looks like your data is actually JSON. Parse it like this:

JSON.parse(querystring.parse(theUrl.query));
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.