--15500行插入 javascript
var svgNode = svgDocument.getElementsByTagName("g")[0]; //outer most g node //插入的修改 if (!Document.prototype.createAttributeNS) {<br /> Document.prototype.createAttributeNS = function(namespaceURI, qualifiedName) {<br /> var dummy = this.createElement('dummy');<br /> dummy.setAttributeNS(namespaceURI, qualifiedName, '');<br /> var attr = dummy.attributes[0];<br /> dummy.removeAttributeNode(attr);<br /> return attr;<br /> };<br /> }<br /> if (!Element.prototype.setAttributeNodeNS) {<br /> Element.prototype.setAttributeNodeNS = Element.prototype.setAttributeNode;<br /> }<br /> // set all required attributes<br /> var attributeTitle = svgDocument.ownerDocument.createAttributeNS(null, "title");
這樣就ok了html
thanks forjava