Can anyone decode this for me -
alert(res) //null
jQuery.ajax( type, url, params,function(res, status){
alert(res) // contains the response code
if ( status == "success" || !ifModified && status ==
"notmodified" ) {
// Inject the HTML into all the matched elements
self.html(res.responseText).each( callback,
[res.responseText, status] );
// Execute all the scripts inside of the newly-injected HTML
$("script", self).each(function(){
if ( this.src )
$.getScript( this.src );
else
eval.call( window, this.text || this.textContent ||
this.innerHTML || "" );
});
} else
callback.apply( self, [res.responseText, status] );
}
on lines 1 and 3 I put alerts - I'm confused as where the res variable
in the function comes from - since res does not exist before the
function in the code how can it be a variable in the function?
> On 8/29/06, *Will Jessup* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Matt,
>
> Hehe. well jQuery has quite a bit of cool code I just can't seem
> to get
> it to work.
> Firstly it seem the functions $.ajaxStart, $.ajaxComplete etc. are
> attached globally and triggered when they should be,
> 2nd it says that there is a 2nd variable for the callback that has the
> status in it, like
> $.getIfModified('/ajaxmessages.php', '', function(json, "error"){
>
> so the callback fires on error(?), but doesn't work.
>
> Will
>
>
> Try this link: http://proj.jquery.com/discuss/2006-July/007606/
>
> I believe it has the answers you are looking for.
>
> Cheers,
>
> --
> Shawn Tumey
> Cofounder
> MT Web Productions LLC
> ------------------------------------------------------------------------
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/