[HTML_AJAX-devel] HTML_AJAX.call send an array as an argument?
Laurent Yaish
laurenty at gmail.com
Wed May 9 09:26:42 PDT 2007
Steve,
I modified one of the examples to test it. (proxyless_usage.php)
function callSync() {
HTML_AJAX.defaultEncoding = 'JSON'; // set encoding to JSON encoding method
var arg1 = [1,2,3];
document.getElementById('target').innerHTML =
HTML_AJAX.call('test','dump',false,['Im text that was echoed'], arg1);
HTML_AJAX.defaultEncoding = 'Null'; // return it to default which is Null
}
Here's what firebug shows in POST:
[["Im text that was echoed"],[1,2,3]]
All the arguments make it to test::dump() fine.
Are you using the latest version? Can you paste some of your code?
Laurent
On 5/9/07, Steve Kingsley <smk at simplicity-solutions.com> wrote:
>
> Hi Laurent,
>
> Thanks for the reply.
>
> First I tried:
> var myArray = new Array('test1','test2');
> HTML_AJAX.call('class', 'method', callback, 'arg1', myArray);
>
> then I tried your suggestion and put the array in-line. The problem I get is that the method I'm calling takes two arguments and the error I get is: missing argument 2. Using firebug to try and see what is going on, it looks as though the array is just not passed.
>
> Cheers for the help, any other ideas?
> Steve
>
> Laurent Yaish wrote:
>
> Hi Steve,
>
> Sure you can. try something like:
> HTML_AJAX.call('class','method',callback,[1, 2, 3])
>
> Laurent
>
>
> On 5/9/07, Steve Kingsley <smk at simplicity-solutions.com> wrote:
> > Hi,
> >
> > This may be a simple question and I think I know the answer will be no
> > but here goes anyway:
> > When you use the HTML_AJAX.call function, can you send a javascript
> > built array as an argument?
> >
> > Cheers
> > Steve
> > _______________________________________________
> > Html_ajax-devel mailing list
> > Html_ajax-devel at lists.bluga.net
> > http://lists.bluga.net/mailman/listinfo/html_ajax-devel
> >
>
>
> _______________________________________________
> Html_ajax-devel mailing list
> Html_ajax-devel at lists.bluga.net
> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>
>
More information about the Html_ajax-devel
mailing list