Search code examples
phpajaxjsonjquerystringify

What does JSON.stringify data look like in the url


I use JSON.stringify to send jQuery arrays to $_POST data to a PHP file through an .ajax() call. The call works fine and the desired data is returned, but:

If I was going to debug and type in variables manually, what does this data look like in url format?

http://domain.com/ajax.php?foo=1,2&bar=3,4 or something else?

MY SOLUTION: URL is http://domain.com/ajax.php?foo=[1,2]&bar=[3,4]


Solution

  • I would recommend using fiddler and use the Composer therefore you dont have to use separate code for debugging. You can also test what the result would look like by using the console in IE. Generally json.stringy turns your json into a string so it would look like

    [1,2,3,4,5,6,7]