Re: [jQuery] help w/ getIfModified

2006-08-30 Thread Mike Alsup
 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?

You're giving jQuery.ajax() a callback function as the 4th arg.  When
that function is called it is passed the XMLHttpRequest and the
status.  Take a look at onreadystatechange in the source code.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] help w/ getIfModified

2006-08-30 Thread Taku Sano (Mikage Sawatari)
This sample helps you?

http://pepper.sherry.jp/jquery/newajaxfunc2.html

$().load() / $().get() / $.().post() callback's 2nd argument shows status.
If status == 'success', ajax request succeeded.
If status == 'error', ajax request failed. (because file not found,
timeout, etc.)

When $().loadIfModified() / $().getIfModified called,
the status of notmodified might return.
When the file on the server has not been changed, notmodified is returned.

This is useful to monitor the change of the file periodically.


On 8/30/06, Will Jessup [EMAIL PROTECTED] wrote:
 Still working on the GetIfModified as outlined here:

 http://www.mail-archive.com/discuss@jquery.com/msg00481.html

 Any examples of how to use this properly? I'm not sure how to grab the
 states success, failure, notomdified etc.

 will

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/



-- 
 ---
 Handle : 沢渡 みかげ ([EMAIL PROTECTED])   ☆沢渡 みかげ☆
 PGP5 DH/DSS key FP : 76D9 DBB7 5E3C 865B 7A60  A1E8 0A97 3DF0 B130 0941
You can get my PGP key at http://www.mikage.to/mikage/mikage.asc

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] help w/ getIfModified

2006-08-29 Thread Will Jessup
Still working on the GetIfModified as outlined here:

http://www.mail-archive.com/discuss@jquery.com/msg00481.html

Any examples of how to use this properly? I'm not sure how to grab the 
states success, failure, notomdified etc.

will

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] help w/ getIfModified

2006-08-29 Thread Matt Stith
Well with HTTP codes, i know that code 200 is success.. thats about it..On 8/29/06, Will Jessup [EMAIL PROTECTED]
 wrote:Still working on the GetIfModified as outlined here:
http://www.mail-archive.com/discuss@jquery.com/msg00481.htmlAny examples of how to use this properly? I'm not sure how to grab thestates success, failure, notomdified etc.will___
jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] help w/ getIfModified

2006-08-29 Thread Shawn Tumey
On 8/29/06, Will Jessup [EMAIL PROTECTED] wrote:
Matt,Hehe. well jQuery has quite a bit of cool code I just can't seem to getit to work.Firstly it seem the functions $.ajaxStart, $.ajaxComplete etc. areattached globally and triggered when they should be,
2nd it says that there is a 2nd variable for the callback that has thestatus in it, like$.getIfModified('/ajaxmessages.php', '', function(json, error){so the callback fires on error(?), but doesn't work.
WillTry this link: http://proj.jquery.com/discuss/2006-July/007606/I believe it has the answers you are looking for.
Cheers,-- Shawn TumeyCofounderMT Web Productions LLC
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] help w/ getIfModified

2006-08-29 Thread Will Jessup
Shawn ,

Ah so obvious now, thx.

Will
 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
 discuss@jquery.com
 http://jquery.com/discuss/
   


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] help w/ getIfModified

2006-08-29 Thread Will Jessup
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
 discuss@jquery.com
 http://jquery.com/discuss/
   


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/