[jQuery] $.post array
[jQuery] $.post array
Hi there
I'm trying to send some data to a server side function via $.post
My code looks like this:
$.post("ajax.php", {page:"mypage.php", action:"functionName", params:["param1", "param2"]});
Basically ajax.php does an include of mypage.php and calls the functionName(), passing the array of params.
The problem I'm having is that when I have more than one value in the params array, the data is not sent correctly.
In FireBug the XMLHttpRequest being generated from the above code is
<pre selected="true" class="XHRSpyPostText XHRSpyText">ajax.php
page=mypage.php&action=functionName¶ms=param1%2Cparam2
</pre>Is it the %2C stuff causing the problem? PHP is not recognising params as a valid array.
Any help would be much appreciated :)
Chris
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/