Bug Tracker

Ticket #8950 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

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

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

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

comment:1 Changed 4 years ago by anonymous

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

comment:2 Changed 4 years ago by rwaldron

  • Owner set to rwaldron
  • Priority changed from undecided to blocker
  • Status changed from new to assigned
  • Component changed from unfiled to manipulation

comment:4 Changed 3 years ago by timmywil

  • Milestone changed from 1.next to 1.6.2

comment:5 Changed 3 years ago by rwaldron

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

comment:6 Changed 3 years ago by Rick Waldron

  • Status changed from assigned to closed
  • Resolution set to fixed

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

More Details:

comment:7 Changed 3 years ago by rwaldron

#9498 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.