[英]Updating JS to work with IE10
我承担了为IE10更新一些Javascript的任务。 我一直在寻找解决方案,但是似乎找不到。 我遇到的那段代码是:
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);
else
this.svgDoc.getDocumentElement.appendChild(this.grp);
最后一行是失败的地方,给我错误无法获取未定义或null引用的属性appendChild
。 我似乎无法弄清楚为什么它是IE8及更低版本的null引用。
getDocumentElement应该只是documentElement根据工程上几乎所有IE版本, 这
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.