Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#8950 closed bug (fixed)

(Chrome, Firefox) Second argument (event empty) in jQuery throws error while creating <input>

Reported by: shocksilien@… Owned by: Rick Waldron
Priority: blocker Milestone: 1.6.2
Component: manipulation Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

Description

Link to test: http://theshock.github.com/trash/jquery-input-bug/index.html

// Error:
Uncaught TypeError: Object #<Object> has no method 'createDocumentFragment'

// Here:
    if ( !fragment ) {
        fragment = doc.createDocumentFragment(); // <====
        jQuery.clean( args, doc, fragment, scripts );
    }

Test code:

$(function() {
	// success:
	$('<div />', {});
	$('<input>', { 'class': 'test' });
	$('<input type="hidden" />').attr({ 'class': '123' });

	// fail:
	$('<input type="hidden" />', { 'class': 'test' });
	$('<input type="hidden" />', {});

Change History (7)

comment:1 Changed 7 years ago by anonymous

Test case at jsFiddle: http://jsfiddle.net/YYqgM/

comment:2 Changed 7 years ago by Rick Waldron

Component: unfiledmanipulation
Owner: set to Rick Waldron
Priority: undecidedblocker
Status: newassigned

comment:4 Changed 7 years ago by timmywil

Milestone: 1.next1.6.2

comment:5 Changed 7 years ago by Rick Waldron

The correct pull request is here: https://github.com/jquery/jquery/pull/365

comment:6 Changed 7 years ago by Rick Waldron

Resolution: fixed
Status: assignedclosed

Landing pull request 365. jQuery.buildFragment, ensure doc is a document; Fixes #8950.

More Details:

comment:7 Changed 7 years ago by Rick Waldron

#9498 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.