Skip to main content

Bug Tracker

Side navigation

#4805 closed bug (duplicate)

Opened June 22, 2009 09:56PM UTC

Closed June 23, 2009 01:17AM UTC

Last modified March 15, 2012 04:04PM UTC

.append breaks in IE8 with more than one string argument

Reported by: dantman Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

.append seams to break in some circumstances in IE8. Note that this bug may also affect Konqueror.

$('#bodyContent').append( "[" ); works

$('#bodyContent').append( "[", "]" ); "Invalid argument" in IE8 console, works in FF Firebug console

$('#bodyContent').append( "asdf", "asdf" ); "Invalid argument" in IE8 console, works in FF Firebug console

$('#bodyContent').append( document.createTextNode("["), "]" ); works

$('#bodyContent').append( "<span>foo</span>", "]" ); // in IE8 console only inserts the ']' the foo span is not inserted, works in FF Firebug console

$('#bodyContent').append( "<span>asdf</span>", "<span>qwerty</span>" ); // in IE8 console only inserts the qwerty span the asdf span is not inserted, works in FF Firebug console

So this looks like an IE8 (maybe Konqueror) issue where when .domManip is used (by something like .append) with more than one argument with the first being a string a "Invalid argument" error is thrown if the first argument is not a valid node string. If the first argument is a valid node string, instead the first argument is ignored and the rest are inserted.

Attachments (0)
Change History (3)

Changed June 22, 2009 09:58PM UTC by dantman comment:1

Tracker mangled the examples.

$('#bodyContent').append( "[" ); // works
$('#bodyContent').append( ", ?" ); // "Invalid argument" in IE8 console, works in FF Firebug console
$('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 console, works in FF Firebug console
$('#bodyContent').append( document.createTextNode("), ?" ); // works
$('#bodyContent').append( "<span>foo</span>", "]" ); // in IE8 console only inserts the ']' the foo span is not inserted, works in FF Firebug console 
$('#bodyContent').append( "<span>asdf</span>", "<span>qwerty</span>" ); // in IE8 console only inserts the qwerty span the asdf span is not inserted, works in FF Firebug console

Changed June 22, 2009 09:59PM UTC by dantman comment:2

Sorry, I wish the tracker had an edit button:

$('#bodyContent').append( "[" ); // works
$('#bodyContent').append( "[", "]" ); // "Invalid argument" in IE8 console, works in FF Firebug console
$('#bodyContent').append( "asdf", "asdf" ); // "Invalid argument" in IE8 console, works in FF Firebug console
$('#bodyContent').append( document.createTextNode("["), "]" ); // works
$('#bodyContent').append( "<span>foo</span>", "]" ); // in IE8 console only inserts the ']' the foo span is not inserted, works in FF Firebug console
$('#bodyContent').append( "<span>asdf</span>", "<span>qwerty</span>" ); // in IE8 console only inserts the qwerty span the asdf span is not inserted, works in FF Firebug console

Changed June 23, 2009 01:17AM UTC by dmethvin comment:3

resolution: → duplicate
status: newclosed

Duplicate of #4011