views:

1602

answers:

2

And how exactly does it relate to jquery? I know the library uses native javascript functions internally, but what exactly is it trying to do whenever such a problem appears?

Thx for any response in advance.

A: 

I am interested in this issue, if I'm guided by what I found HTML::DOM::Exception , would think I am making a mistaken operation. if you have the code would be easier to see what happens. I think you could give in the event that an XML SCHEMA a thong and I would insert an element where appropriate.

andres descalzo
This question was just a general one because i got this error often enough with jquery, especially in compination with dom-manipulation.Mostly what i do is to try to figure out what i am appending to what, but it would be nice to know what is allowed by that schema.
Julian Weimer
appendChild(...) returns the child node, which is why chaining, a la jquery, would cause this error.
Fraser Harris
+6  A: 

It means you've tried to insert a DOM node into a place in the DOM tree where it cannot go. The most common place I see this is on Safari which doesn't allow the following:

document.appendChild(document.createElement('div'));

Generally, this is just a mistake where this was actually intended:

document.body.appendChild(document.createElement('div'));
Kelly Norton
The error also occurs when you try and append a node to itself. I just ran into this one myself :-)
Ben Clayton