我正在尝试使用 JavaScript 动态创建路径,但该d
属性不断给出Uncaught SyntaxError: Unexpected token ILLEGAL.
var location = document.createElementNS(svgns,"path");
location.setAttributeNS("fill-rule","evenodd");
location.setAttributeNS("fill","#ffffff");
location.setAttributeNS("clip-rule","evenodd");
location.setAttributeNS(null,"d","M57.295,27.757c-11.896,0-21.539,9.643-21.539,21.539S57.295,86.5,57.295,86.5
s21.539-25.309,21.539-37.205S69.19,27.757,57.295,27.757z M57.295,60.039c-6.373,0-11.539-5.166-11.539-11.539
s5.166-11.539,11.539-11.539S68.833,42.127,68.833,48.5S63.667,60.039,57.295,60.039z");
locationBTn.appendChild(locationStroke0);
locationBTn.appendChild(location);
document.getElementsByTagName('svg')[0].appendChild(locationBTn);