Dmitrii 'Mamut' Dimandt wrote: > Mike Alsup wrote: >>> $.ajaxStart() is invoked for every ajax call that's made on the page. >>> >>> However, for one ajax call I need to display a "loading..." in one >>> place, for another ajax call - a "loading..." in another place and for >>> yet a third ajax call a "loading" in a third place. >>> >>> How can I do this in jQuery? Preferably, in one line (true to jQuery >>> spirit :)) ). >>> >> >> You may want to use ajaxSend instead ajaxStart. ajaxSend is passed >> the xhr and the settings object for the ajax call. This should give >> you the context you need to figure out where the loading indicator >> should go. >> >> $().ajaxSend(function(e, xhr, settings) { >> // your code >> }); >> >> Mike >> >> > Still. This is still like a proctologist performing an eye surgery :)) > Big thanks for the tip, though! >
I think you need to define your problem in more detail if you want concrete help with it. Like, how do you plan to identify and differentiate the different "loading" locations and respective messages? How is the first, second and third place identified in the DOM or in you code, or in your mind? Do you have a metadata structure that defines these that can be used to pull information from? etc. How do each of these separate ajax requests get initiated? What would your code look like if you didn't have the "loading" messages running. If you ask really abstract questions you should probably expect to get abstract responses because we can only guess at your needs. I'm sure the list will help if there is enough information. This sounds like an interesting problem that others might run into. -Steve _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/