1

I have 2 divs, they have multiples elements and each element has options(events). In the first div, each element has a button that load, in the second div, the children elements. Those children have a edit button that opens a dialog where the user can edit.

Here is the script:

$("#Content").load("elements.php?id=5", function(){
    $.ajaxSetup({cache: true});
    $.getScript("../js/elements.js", function(){
        $.ajaxSetup({cache: false});
    });
})

The problem is: When I load #Content with its script, it`s works good only in the first time, it opens one dialog box, but if I load twice, it opens two dialog boxes, and three, etc.

How do I delete the last script I loaded?

4

1 に答える 1

0

バインディングはありますか?ライブなどは?あなたの現在のコードがこの問題を引き起こしているのか、それとも elements.js がその中に何が入っているのかわからないということなのかはわかりません。Jquery stopImmediatePropagation()をチェックすることをお勧めします。これがあなたを正しい道に導くことができることを願っています。

于 2012-09-10T02:07:15.190 に答える