Bug Tracker

Opened 13 years ago

Closed 12 years ago

#6741 closed bug

event binding issue when append html by using $.html() in IE

Reported by: walter Owned by: walter
Priority: undecided Milestone: 1.4.3
Component: core Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:


there are two pages, A.htm and B.htm I ajax load page B.htm in A.htm. but i found that events binding in B.htm does not work in ie. there are the codes:

======================================================= a.htm

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head>

<script src="jquery-1.4.2.js" type="text/javascript"></script>

</head> <body>

<a href="#" onclick="$('#container').load('B.htm');" >ajax load B.htm</a>

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

<script type="text/javascript">

$.ajaxSetup({ cache: false });


</body> </html>

b.htm =======================================================

<input type="button" onclick="alert('button click!');" value="click me to test onclick"/> <script type="text/javascript"></script>

repro steps:

  1. open a.htm in ie
  2. click the link to load A.htm, then you can see a button
  3. click the button to check weather the 'cnclick' event fire by a popup message box.


  1. this issue only repro in ie
  2. if B.htm doesn't contains any script tag, everything is fine.
  3. the scripts include in script tag work fine.

can anybody help?

Change History (4)

comment:1 Changed 12 years ago by addyosmani

Owner: set to walter
Priority: undecided
Status: newpending

Is there a particular version of IE where you are experiencing this problem?

comment:2 Changed 12 years ago by walter

Status: pendingnew

I have tried it on IE6 & IE8.

comment:3 Changed 12 years ago by snover

Status: newpending

Please provide a live test case demonstrating this issue.

comment:4 Changed 12 years ago by trac-o-bot

Status: pendingclosed

Automatically closed due to 14 days of inactivity.

Note: See TracTickets for help on using tickets.