document.createSvg = function(tagName) {
var svgNS = "http://www.w3.org/2000/svg";
return this.createElementNS(svgNS, tagName);
};
var svgPie = document.createSvg("svg");
metric_name = document.createSvg("g");
text_metric = document.createSvg("text");
text_metric.appendChild(document.createTextNode(data[i]['name']));
text_metric.setAttribute("name",data[i]['name']);
text_metric.setAttribute("text-anchor","start");
text_metric.setAttribute("font-size","13");
text_metric.setAttribute("id", data[i]['id']);
resetList = document.getElementsByTagName("text");
alert(resetList[0]);
metric_name.appendChild(text_metric);
svgPie.appendChild(metric_name);
以上警报给了我未定义的信息。能否给出解决的原因和解决方法