Вопрос

In my web page i am creating some button dynamically and By using ON binding some event with the button ,on some condition i have to disable this button for that i am using die() method but it is not seems to be working on ie7 ,it is working fine on mozilla and chrome

$('#BtnShow').die('click');

Is there any wayaround for ie7?

Это было полезно?

Решение

Use .off when you bind events using .on.

Use .die when you bind events using .live. (Note: both .live and .die are deprecated.)

Use .undelegate when you bind events using .delegate

Use .unbind when you bind events using .bind.

Note: When using delegated events, make sure the selector used in .on/.delegate/.live matches with the selector in .off/.undelegate/.die

Другие советы

.die() is deprecated now, try using .off()

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top