I actually hadn’t dug through the jQuery code itself.  So that’s saying that
if I enter any additional parameter to the server, it will send a POST
request?  That may be good for me in most cases.


On 5/18/07 11:24 AM, "?ⓐⓚⓔ" <[EMAIL PROTECTED]> wrote:

> wow! it does!
>     load: function( url, params, callback, ifModified ) {
>         if ( jQuery.isFunction( url ) )
>             return this.bind("load", url);
> 
>         callback = callback || function(){};
> 
>         // Default to a GET request
>         var type = "GET";
> 
>         // If the second parameter was provided
>         if ( params )
>             // If it's a function
>             if ( jQuery.isFunction( params ) ) {
>                 // We assume that it's the callback
>                 callback = params;
>                 params = null;
> 
>             // Otherwise, build a param string
>             } else {
>                 params = jQuery.param( params );
>                 type = "POST";
>             }
> 
>         var self = this;
> 
>         // Request the remote document
>         jQuery.ajax({
>             url: url,
>             type: type,
>             data: params,
>             ifModified: ifModified,
>             complete: function(res, status){
>                 if ( status == "success" || !ifModified && status ==
> "notmodified" ) 
>                     // Inject the HTML into all the matched elements
>                     self.attr("innerHTML", res.responseText)
>                       // Execute all the scripts inside of the newly-injected
> HTML 
>                       .evalScripts()
>                       // Execute callback
>                       .each( callback, [res.responseText, status, res] );
>                 else
>                     callback.apply ( self, [res.responseText, status, res] );
>             }
>         });
>         return this;
>     },
> 
> 
> On 5/18/07, Brian Cherne < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > 
> wrote:
>> It's not documented (as far as I can tell) but if you send a params object to
>> .load() it should be sent via the POST method. I'm looking at the unpacked
>> source of jQuery 1.1.1... load: starts on line 1842 and the GET/POST
>> condition starts on line 1849.
>> 
>> Brian.
>> 
>> On 5/18/07, Shelane < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote:
>>> 
>>> It would be nice if the .load function of jQuery did a POST request
>>> instead of a GET request or if we could specific that it should be a
>>> POST request.
>>> 
>>> On May 18, 8:10 am, wls < [EMAIL PROTECTED]
>>> <mailto:[EMAIL PROTECTED]> > wrote:
>>>> > You're correct.  IE is caching GETs.  The work around is to make a
>>>> > unique GET (e.g., all the date/time bogus parameters) or to use POST
>>>> > instead.
>>>> > 
>>>> > 
>>>> Seehttp://www.wwco.com/~wls/blog/2007/04/12/an-advanced-crash-course-in-...
>>>> >
>>>> > -wls
>>> 
>> 
> 
> 


Reply via email to