0

この JavaScript の多くを IE10 で動作するように変更することができましたが、さらに別の問題に遭遇しました。今回は、if (this.parent) 部分のコード行でUnable to get property 'appendChild' of undefined or null reference を取得しています。

var svgns = "http:///www.w3.org/2000/svg"
this.svgDoc = document.getElementById("SVGDoc").getSVGDocument();
this.grp = this.svgDoc.createElementNS(svgns, "g");
this.grp.setAttribute("id", this.id);

if (this.parent)
   this.svgDoc.getElementById(this.parent.id).appendChild(this.grp); //This Line
else
   this.svgDoc.getDocumentElement.appendChild(this.grp);

なぜこれが起こっているのか本当に混乱しています。何か案は?

4

0 に答える 0