Hola,
estoy realizando un Script, para generar algo que yo llamo "Jerarquia Avanzada", entonses, lo que que hago es crear elementos dinamicamente y añadirlos a un elemento padre.
El error:
Código:
Error: uncaught exception:
[Exception... "Node cannot be inserted at the specified point in the hierarchy"
code: "3"
nsresult: "0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)"
location: "file:///D:/mysite/lyn/dhtml/dhtml.js
Line: 82"]
y el Script:
Código Javascript
:
Ver originaldhtElement = new Class({ //dhtElement es un Objeto base para crear otros
initialize:function(data){
for (prop in data) {
this[prop] = data[prop]
if (typeof(data[prop].element) != 'undefined' || data[prop].element != null) {
alert(this.element)
this.element.appendChild(data[prop].element) // linea 82
}
}
},
element:null, // Este es el elemento HTML, se coloca
x:function(){},
y:function(){},
width:function(){},
height:function(){},
draw:function(){
return this.element
}
})
dhtComponent = new Class({
element:$C("div")
},dhtElement)
/* Layer Types */
dhtLayer = new Class({},dhtElement) // Aquí creo la sub clase
lyrDIV = new Class({
element:$C('div') //$C = document.createElement, especifico el
//elemento que estaba en null mas arriba
},dhtLayer)