Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#9855 closed bug (cantfix)

html(data) function, where the data contains the "onchange" - attribute doesn't attach the onchange event in IE 9

Reported by: anonymous Owned by:
Priority: low Milestone: None
Component: manipulation Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:

Description

$(document).ready(function () { $('#div').append('<div>No Event:</div><select onchange="window.alert(' + "'changed'" + ');"><option>Change event not attached</option><option>and not fired in IE 9</option></select>')

});

<div id="div"></div>

(works fine in FF, Safari)

Change History (2)

comment:1 Changed 8 years ago by timmywil

Component: unfiledmanipulation
Priority: undecidedlow
Resolution: cantfix
Status: newclosed

comment:2 Changed 8 years ago by dmethvin

Just to follow up, the reason we can't fix this is because IE does not correctly handle the change event. When you attach this event via a jQuery handler via .bind, .live, or .delegate we make heroic efforts to simulate its behavior. We can't do that for inline handlers. In general, inline handlers are bad practice and we do not recommend using them.

Note: See TracTickets for help on using tickets.