Bug Tracker

Modify

Ticket #3948 (closed bug: invalid)

Opened 4 years ago

Last modified 14 months ago

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:
Blocking: Blocked by:

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)

Change History

comment:1 Changed 4 years ago by ziegenberg

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>

comment:2 Changed 4 years ago by dmethvin

  • Priority changed from major to minor
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfilled to core

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.