1

I have been running the following jquery code in IE8 (with jquery 1.4.2). This is working in all other browser like Mozilla, IE9 and so on, but not working in IE8.

Could anyone tell me how can I fix this issue or using the similar code to do the same 'change' function?

$('.input-timesheet-type').live('change', function () {
   totalCount($(this).attr('data-teamid'));
});
dsgriffin
  • 66,495
  • 17
  • 137
  • 137
Jin Yong
  • 42,698
  • 72
  • 141
  • 187

2 Answers2

2

Although IE8 supports live(), live() has some problems using the change() event:

Possible event values: click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, keydown, keypress, keyup

Currently not supported: blur, focus, mouseenter, mouseleave, change, submit

dsgriffin
  • 66,495
  • 17
  • 137
  • 137
0

You can use .delegate instead of .live, it became available in v1.4.2

.delegate() in jQuery Documentation

Also, .live() does not exist in recent versions of jQuery so, .delegate() will future-proof your code a little better.

BumbleB2na
  • 10,723
  • 6
  • 28
  • 30