show a 'loading' element just before the ajax request, and hide it
again with the callback?
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/
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
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();
});
}
but since you already specify the target element for the .load() at
some point, you'll already have it to put in the callback?
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');
uuh, the callback is wrong though. you'll want to do somethign like
contEl.children(#loadIcon).remove();
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
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
: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
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
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
@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
,
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
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
...@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
] 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
17 matches
Mail list logo