>> 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...
> 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
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.
___
> $().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
> 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
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'
});
}
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/
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
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