Skip to main content

Bug Tracker

Side navigation

#3948 closed bug (invalid)

Opened January 22, 2009 05:37AM UTC

Closed August 08, 2009 03:13AM UTC

Last modified March 15, 2012 02:46PM UTC

wrap() throws NS_ERROR_DOM_HIERARCHY_REQUEST_ERR exception

Reported by: dmuir Owned by:
Priority: minor Milestone: 1.3.1
Component: core Version: 1.3
Keywords: wrap, wrapAll Cc:
Blocked by: Blocking:
Description

wrapping an element in the document tree throws an exception in Firefox

sample from my code:

var wrapper = $('<div></div>');
//$this refers to "$(this)" where "this" is a select element
$this.before(wrapper); 
wrapper.wrap('<div></div>'); 

//this doesn't work either:
$this.wrap('<div></div>');

same issue with wrapAll()

Didn't work in 1.3 either.

from Firebug console:

uncaught exception: Node cannot be inserted at the specified point in the hierarchy (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)

[Break on this error] fragment.appendChild( ret[i] );

jquery-1.3.1.js (line 948)

Attachments (0)
Change History (2)

Changed May 13, 2009 12:38PM UTC by ziegenberg comment:1

Also occurs when using the wtooltip plugin http://wayfarerweb.com/wtooltip.php with ajax. The ajax GET returns a simple table like:

<table>
<tr><td>2009-05-13 14:36:41</td> <td>Getting source from SVN</td></tr>
</table>

Changed August 08, 2009 03:13AM UTC by dmethvin comment:2

component: unfilledcore
priority: majorminor
resolution: → invalid
status: newclosed

You can't wrap an element unless it's in the document, since wrapping it requires a parent node.