[jQuery] $.post array

[jQuery] $.post array

For the time being, maybe you could split the params on "%2C" then convert
into an array?
<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
andy@icglink.com
615.370.1530 x737
--------------//--------->
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com]On
Behalf Of Chris Domigan
Sent: Thursday, July 13, 2006 7:06 PM
To: jQuery Discussion.
Subject: [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
ajax.phppage=mypage.php&action=functionName&params=param1%2Cparam2
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/


































    • Topic Participants

    • andy