Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#4805 closed bug (duplicate)

.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.

Change History (3)

comment:1 Changed 10 years ago by dantman

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

comment:2 Changed 10 years ago by dantman

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

comment:3 Changed 10 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Duplicate of #4011

Note: See TracTickets for help on using tickets.