0

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?

user1544004
  • 207
  • 4
  • 9

2 Answers2

1

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

Andrea Turri
  • 6,480
  • 7
  • 37
  • 63
1

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

Selvakumar Arumugam
  • 79,297
  • 15
  • 120
  • 134