I need help. I\'m getting the following error in IE9. The code is working in FireFox:
SCRIPT438: Object doesn\'t support property or method \'on\'
>
One of two things is happening:
$
is not jQuery
, but a function defined elsewhere; or,
$
is not the correct version of jQuery. on was introduced in 1.7.
For jQuery 1.6 the following on
:
$(document).on('change', '#dropdownval select', ...)
can be written using delegate (since 1.4, deprecated 1.7):
$(document).delegate('#dropdownval select', 'change', ...)
can be written using live (since 1.3, deprecated):
$('#dropdownval select').live('change', ...)
Please refer to the documentation for more options and caveats.
Using delegate
can attach "below" the body (like on
) where as live
always attaches at the body level. Thus the above could possibly be written more efficiently, depending upon where the target is located.
Happy coding.