[jQuery] Re: ajaxStart() question

2009-03-06 Thread ryan.j
show a 'loading' element just before the ajax request, and hide it again with the callback?

[jQuery] Re: ajaxStart() question

2009-03-06 Thread ryan.j
oh and it may or may not be any use, but you can grab all manner of nice animated loading graphics here... http://www.ajaxload.info/

[jQuery] Re: ajaxStart() question

2009-03-06 Thread Alexandre Plennevaux
yes, thanks but that does not help my specific need: what i need to know is if the ajax object stores the container in which it will load the content in a property that i can retrieve, so that the load animation goes on top of it. On Fri, Mar 6, 2009 at 11:11 AM, ryan.j

[jQuery] Re: ajaxStart() question

2009-03-06 Thread ryan.j
off the top of me head i can't remember if load() ovewrites or appends to an element, if it overwrites you won't need the callback... function load(el, url) { $(el).append('img id=loadImg src=loading.png /') $(el).load(url, function(){ $('loadImg').remove(); }); }

[jQuery] Re: ajaxStart() question

2009-03-06 Thread ryan.j
but since you already specify the target element for the .load() at some point, you'll already have it to put in the callback?

[jQuery] Re: ajaxStart() question

2009-03-06 Thread ryan.j
but since you already specify the target element for the .load() at some point, you'll already have it to put in the callback? function doLoad(el, url) { var contEl = $(el) contEl .append('img id=loadIcon src=loading.png /'); contEl .load( url, function(){ contEl .remove('#loadIcon');

[jQuery] Re: ajaxStart() question

2009-03-06 Thread ryan.j
uuh, the callback is wrong though. you'll want to do somethign like contEl.children(#loadIcon).remove();

[jQuery] Re: ajaxStart() question

2009-03-06 Thread Alexandre Plennevaux
thanks ryan, but i want to set it generically for all ajax calls, for instance, via ajaxStart() instead of having to attach the behaviour to every single trigger element. On Fri, Mar 6, 2009 at 11:30 AM, ryan.j ryan.joyce...@googlemail.com wrote: but since you already specify the target

[jQuery] Re: ajaxStart() question

2009-03-06 Thread Alexandre Plennevaux
just in case it helps, here is the code i have so far: var $loadAnim = $('div id=loadAnimimg src=ajax-loader_light2.gif //div').appendTo('body'); $loadAnim.ajaxStart(function(el) { // the following behavior will be done each time an ajax call is

[jQuery] Re: ajaxStart() question

2009-03-06 Thread Rick Faircloth
:02 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: ajaxStart() question just in case it helps, here is the code i have so far: var $loadAnim = $('div id=loadAnimimg src=ajax-loader_light2.gif //div').appendTo('body'); $loadAnim.ajaxStart(function(el

[jQuery] Re: ajaxStart() question

2009-03-06 Thread ryan.j
that crossed my mind, but from the comments above i think he he wants multiple content boxes being populated from a number of different triggers, although he's using an id (of which he can only have one instance of anyway) as the identifier for the loading icon. i'm not sure this is the best way

[jQuery] Re: ajaxStart() question

2009-03-06 Thread Alexandre Plennevaux
hi there, well, i trigger the ajax request much like this: no matter what they role is, all my interface buttons finish by an action called UI.refresh({section:'projects', sortby:'time', item:'love-me'}); this function compares the sent properties to the current UI stored properties, and if

[jQuery] Re: ajaxStart() question

2009-03-06 Thread Rick Faircloth
@googlegroups.com Subject: [jQuery] Re: ajaxStart() question hi there, well, i trigger the ajax request much like this: no matter what they role is, all my interface buttons finish by an action called UI.refresh({section:'projects', sortby:'time', item:'love-me'}); this function compares the sent

[jQuery] Re: ajaxStart() question

2009-03-06 Thread Alexandre Plennevaux
, or would a class identifier be sufficient? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Alexandre Plennevaux Sent: Friday, March 06, 2009 10:31 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: ajaxStart() question hi

[jQuery] Re: ajaxStart() question

2009-03-06 Thread ryan.j
yeah, thats basically what i was thinking. personally i'd try to track the container and use a generic piece of code for the the loading image. that way you could just use $ (container).child(.loading) to traverse the DOM. or if for any reason you want to make them unique perhaps even build an

[jQuery] Re: ajaxStart() question

2009-03-06 Thread ryan.j
...@googlegroups.com] On Behalf Of Alexandre Plennevaux Sent: Friday, March 06, 2009 10:31 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: ajaxStart() question hi there, well, i trigger the ajax request much like this:  no matter what they role is, all my interface buttons finish

[jQuery] Re: ajaxStart() question

2009-03-06 Thread Alexandre Plennevaux
] Re: ajaxStart() question hi there, well, i trigger the ajax request much like this:  no matter what they role is, all my interface buttons finish by an action called UI.refresh({section:'projects', sortby:'time', item:'love-me'}); this function compares the sent properties