[HTML_AJAX-devel] HTML_AJAX.fullcall and call
Laurent Yaish
laurenty at gmail.com
Fri Sep 7 08:41:50 MST 2007
I see what's happening...
The call method is defined with 3 arguments (className, method, callback)
all arguments beyond the 3rd are collected and put into an array that is
then passed to fullcall
so the array you are passing to call is itself an element of the args array
passed to fullcall
try calling fullcall with [obj]
here's what the call method does:
call: function(className,method,callback) {
var args = new Array();
for(var i = 3; i < arguments.length; i++) {
args.push(arguments[i]);
}
return
HTML_AJAX.fullcall(HTML_AJAX.defaultServerUrl,HTML_AJAX.defaultEncoding,className,method,callback,args);
Laurent
On 9/7/07, Brinley Ang <brinley at unbolt.net> wrote:
>
> Hi,
>
> This is not the case in HTML_AJAX 0.5.2
> Using the proxyless_usage.php example
> I added the following functions and executed them
>
> function testCall() {
> obj=new Object();
> obj["text1"]="apple";
> obj["text2"]="orange";
> HTML_AJAX.call('test','dump',callCallback,obj);
> }
>
> function testFullcall() {
> obj2=new Object();
> obj2["text1"]="apple";
> obj2["text2"]="orange";
>
> HTML_AJAX.fullcall(HTML_AJAX.defaultServerUrl,HTML_AJAX.defaultEncoding,'test','dump',callCallback,obj2);
> }
>
> Running both functions, I found that testCall returns the correct
> array dump but testFullcall only returns "apple".
>
> In fact
> HTML_AJAX.call('test','dump',callCallback,obj);
> is instead equivalent to
>
> HTML_AJAX.fullcall(HTML_AJAX.defaultServerUrl,HTML_AJAX.defaultEncoding,'test','dump',callCallback,[obj]);
>
> Thats the obj argument within an array.
> Im not sure if this can be considered a bug but it sure is not
> documented anywhere.
> Thanks
>
> Regards,
> Brinley
>
> On 9/7/07, Laurent Yaish <laurenty at gmail.com> wrote:
> > yes, it is
> >
> > Laurent
> >
> >
> > On 9/6/07, Brinley Ang <brinley at unbolt.net> wrote:
> > >
> > > Hello all,
> > >
> > > Is
> > >
> > > HTML_AJAX.call('test','dump',callCallback,obj);
> > >
> > > the equivalent of
> > >
> > >
> >
> HTML_AJAX.fullcall(HTML_AJAX.defaultServerUrl,HTML_AJAX.defaultEncoding,'test','dump',callCallback,obj);
> > >
> > > Regards,
> > > Brinley
> > > _______________________________________________
> > > Html_ajax-devel mailing list
> > > Html_ajax-devel at lists.bluga.net
> > > http://lists.bluga.net/mailman/listinfo/html_ajax-devel
> > >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bluga.net/pipermail/html_ajax-devel/attachments/20070907/392e8f01/attachment-0001.html
More information about the Html_ajax-devel
mailing list