This might be slightly off topic, a javascript script question, but
its being applied to jQuery. :-)

Ok, there is a different in other languages when you do this:

       var p = null;
       xyz(null);
       xyx(p);

It depends on the function prototype and how a language binds to the
function..

In JavaScript, what is passed to the function xyz:

The address of p or the value of p.

Thats the nice thing about higher level languages: Programmers don't
usually need to worry about it. However, that methodology is also
based on the idea the the programmer would not be dealing with
pointers.

I ask because in the jQuery XHR implementation, it has this

     xml.send(s.data);

And s.data is set to null if s.type is "get"

So I am wondering if it safe to assume the user's agent external
prototype for send() expects:

    -   an asciiz string

    -   OLE string (like BSTR) like its normally done in Windows's OLE/
ActiveX/COM/DCOM
        RPC interfacing

Of course, if you are not sure, its always to be safe and do:

       xml.send(( s.type.toLowerCase() == "get" )?null:s.data);

--
HLS

Reply via email to