Skip to main content

Bug Tracker

Side navigation

#8950 closed bug (fixed)

Opened April 23, 2011 11:30PM UTC

Closed May 13, 2011 04:28PM UTC

Last modified March 08, 2012 07:56PM UTC

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

Reported by: shocksilien@gmail.com Owned by: rwaldron
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" />', {});
Attachments (0)
Change History (7)

Changed April 23, 2011 11:34PM UTC by anonymous comment:1

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

Changed April 24, 2011 02:15AM UTC by rwaldron comment:2

component: unfiledmanipulation
owner: → rwaldron
priority: undecidedblocker
status: newassigned

Changed April 25, 2011 11:03PM UTC by rwaldron comment:3

Changed May 11, 2011 06:29PM UTC by timmywil comment:4

milestone: 1.next1.6.2

Changed May 11, 2011 06:31PM UTC by rwaldron comment:5

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

Changed May 13, 2011 04:28PM UTC by Rick Waldron comment:6

resolution: → fixed
status: assignedclosed

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

More Details:

Changeset: ec829431feed29b393b1c22ca97e8af49f47e228

Changed June 02, 2011 05:59PM UTC by rwaldron comment:7

#9498 is a duplicate of this ticket.