Skip to main content

Bug Tracker

Side navigation

#6741 closed bug ()

Opened June 29, 2010 01:43AM UTC

Closed November 11, 2010 11:09PM UTC

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:
Description

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 });

</script>

</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.

description:

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?

Attachments (0)
Change History (4)

Changed October 14, 2010 03:25AM UTC by addyosmani comment:1

owner: → walter
priority: → undecided
status: newpending

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

Changed October 14, 2010 04:39AM UTC by walter comment:2

status: pendingnew

I have tried it on IE6 & IE8.

Changed October 15, 2010 08:59PM UTC by snover comment:3

status: newpending

Please provide a live test case demonstrating this issue.

Changed November 11, 2010 11:09PM UTC by trac-o-bot comment:4

status: pendingclosed

Automatically closed due to 14 days of inactivity.