Skip to main content

Bug Tracker

Side navigation

#10555 closed bug (duplicate)

Opened October 21, 2011 05:13PM UTC

Closed October 22, 2011 12:21AM UTC

Last modified October 22, 2011 12:21AM UTC

.live() + .trigger("change") throws a run time error

Reported by: prashantjain68 Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:
Description

I have an element which is not added to the DOM. An event handler has been attached via .live(). The element dispatches a change event via trigger() and I get the following error ...

<DocumentFragment> has no method getAttribute.

Sample source code ...

<html>

<head>

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

<script>

$(document).ready(function() {

jQuery("[groupId='hobbies']").live("change", myHandler);

var $checkbox = $("<input type='checkbox' groupId='hobbies'/>");

$checkbox.trigger("change");

});

function myHandler() {

}

</script>

</head>

<body>

</body>

</html>

NOTE: I do not get an error If this checkbox was appended to the DOM.

Attachments (0)
Change History (3)

Changed October 21, 2011 06:34PM UTC by prashantjain68 comment:1

Seems like this got submitted twice. This is a duplicate of 10556.

Changed October 22, 2011 12:21AM UTC by dmethvin comment:2

resolution: → duplicate
status: newclosed

Changed October 22, 2011 12:21AM UTC by dmethvin comment:3

Duplicate of #10556.