Reputation: 6627
Is there a easy way to build an ajax query like this with jquery?
http://www.test.com/?value=happy&value=good&value=day
I tried
$.getJSON('http://www.test.com/', {'value': ['happy','good','day']});
but the result becomes http://www.test.com/?value[]=happy&value[]=good&value[]=day
Upvotes: 7
Views: 2901
Reputation: 1807
Just for anyone who comes here through search, you can use the traditional
parameter to $.ajax
and set it to true
then you will get:
http://www.test.com/?value=happy&value=good&value=day
.
Upvotes: 6
Reputation: 3967
This url seems to be good:
http://www.test.com/?value[]=happy&value[]=good&value[]=day
in php you can access the values like an array
Upvotes: -1