Yep, if you remove the elements, the event bindings are gone as well.

-- Josh

----- Original Message ----- From: "Dustin" <[EMAIL PROTECTED]>
To: "jQuery (English)" <jquery-en@googlegroups.com>
Sent: Friday, July 11, 2008 11:04 AM
Subject: [jQuery] Re: Extra AJAX calls being made



Yep, you were right! I was rebinding the events every time the message
box popped up.

Here is a question though...with the message box (which contains the
buttons I'm binding events to), I am essentially just displaying and
hiding it...not creating and deleting it. If I were to completely
remove it from the page would I need to rebind the events?

Thanks!

On Jul 11, 12:38 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
Usually this indicates that somehow, you are rebinding the event handler to the button on each ajax call. Each time you do a binding, it is additive -- there is nothing to check and see if the event handler is already bound. Check your logic and make sure you are only binding the event handler to the
button once.

-- Josh

----- Original Message -----
From: "Dustin" <[EMAIL PROTECTED]>
To: "jQuery (English)" <jquery-en@googlegroups.com>
Sent: Friday, July 11, 2008 8:43 AM
Subject: [jQuery] Extra AJAX calls being made

> I'm working on an app that uses Jquery and the BlockUI plugin. An odd
> problem I'm having is that there are extra ajax calls being made. For
> every Ajax call I make, and the number of calls made increments. In
> other words, the initial ajax call is made by clicking a button in a
> message I display with BlockUI. The next time the message pops up and
> I click the button, TWO ajax calls are made instead of one. The next
> time, three, then four, then five, and it continues to increment every
> time. Any idea of what could be going on?

Reply via email to