Re: [jQuery] Running a function when something changes...

2007-03-01 Thread Nicolas Hoizey
>> Untested, but reading the code I assume this would work: >> >> $("#something").ajaxSuccess(fn); >> >> function fn(r, s) { >> $(this).unbind("ajaxSuccess"); >> // do what you want, then rebind >> $(this).ajaxSuccess("fn"); >> } > > It seems unbind doesn't work on ajaxSuccess or ajaxStop...

Re: [jQuery] Running a function when something changes...

2007-02-23 Thread Nicolas Hoizey
> Untested, but reading the code I assume this would work: > > $("#something").ajaxSuccess(fn); > > function fn(r, s) { > $(this).unbind("ajaxSuccess"); > // do what you want, then rebind > $(this).ajaxSuccess("fn"); > } It seems unbind doesn't work on ajaxSuccess or ajaxStop... -Nicolas

Re: [jQuery] Running a function when something changes...

2007-02-23 Thread Mike Alsup
The settings object is a new object for each call to $.ajax. You should be able to use this technique. > The thing is that I have to run my function each time the element is > updated. > > If I set myTag to 1 on first run, it will never run again. ___

Re: [jQuery] Running a function when something changes...

2007-02-23 Thread Nicolas Hoizey
> $().ready(function(){ > $().ajaxStart($.blockUI).ajaxStop($.unblockUI); > }); Maybe ajaxStop is better than ajaxSuccess for my needs, but I don't need to block the UI. -Nicolas -- Nicolas "Brush" HOIZEY Clever Age : http://www.clever-age.com/ Gastero Prod : http://www.gasteroprod.com/ Ph

Re: [jQuery] Running a function when something changes...

2007-02-23 Thread Nicolas Hoizey
> You can use ajaxSuccess but go ahead and take advantage of the > settings object. Something like: > > $().ajaxSuccess(function(e, xhr, settings) { > if (settings.myTag) return; > // do your extra work and call ajax > $.ajax({ > myTag: 1, > url: blah.php, > typ

Re: [jQuery] Running a function when something changes...

2007-02-23 Thread Mike Alsup
You can use ajaxSuccess but go ahead and take advantage of the settings object. Something like: $().ajaxSuccess(function(e, xhr, settings) { if (settings.myTag) return; // do your extra work and call ajax $.ajax({ myTag: 1, url: blah.php, type: 'post' }); }

Re: [jQuery] Running a function when something changes...

2007-02-23 Thread Benjamin Sterling
I do: $().ready(function(){ $().ajaxStart($.blockUI).ajaxStop($.unblockUI); }); -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] Running a function when something changes...

2007-02-23 Thread Choan C. Gálvez
On 2/23/07, Nicolas Hoizey <[EMAIL PROTECTED]> wrote: > In a page that gets modified by ajax calls, I would like to run my > own function after each change. > > My function does ajax calls, so if I use the ajaxSuccess binding, it > goes recursively and crash... > > Any idea? Untested, but reading

[jQuery] Running a function when something changes...

2007-02-23 Thread Nicolas Hoizey
In a page that gets modified by ajax calls, I would like to run my own function after each change. My function does ajax calls, so if I use the ajaxSuccess binding, it goes recursively and crash... Any idea? -Nicolas -- Nicolas "Brush" HOIZEY Clever Age : http://www.clever-age.com/ Gast