html中的svg文件,我想隐藏javascript formate

时间:2016-07-23 11:49:10

标签: javascript svg

我在html中有一个svg文件,我希望获得路径前面的文件,如

data:[-23.978,2.474,0,-18.691,2.474,0,-16.108,2.595,0,-14.207,2.866,0,-12.443,3.292,0,-11.003,3.793,0,-9.653,4.413,0,-8.741,4.929,0,-7.869,5.506,0,-6.341,6.686,0,-5.837]

像上面这种格式请帮助我。

1 个答案:

答案 0 :(得分:0)

你需要这样的吗?

        - compileSdkVersion 
        - buildToolsVersion    and default config having following,


        - applicationId 
        - minSdkVersion 
        - targetSdkVersion
        - versionCode 
        - versionName 
var x = document.getElementsByTagName("polygon")[0].getAttribute("points"); 


var x = document.getElementsByTagName("path")[0].getAttribute("d"); 
var obj = {};
obj['data'] = x.split(' ');
console.log(obj);