javascript - javascipt json to array conversion master
PHP中文网
PHP中文网 2017-07-05 11:03:13
0
4
895
[{"xc_images":"http:\/\/vrjx.zhed.com\/Public\/mht.jpg"},{"xc_images":"http:\/\/vrjx.zhed.com\/Public\/mht.jpg"},{"xc_images":"http:\/\/vrjx.zhed.com\/Public\/lz.jpg"}]

这样的json怎么转化为 ['http:\/\/vrjx.zhed.com\/Public\/mht.jpg', 'http:\/\/vrjx.zhed.com\/Public\/mht.jpg', 'http:\/\/vrjx.zhed.com\/Public\/mht.jpg']

用JavaScript 怎么转
PHP中文网
PHP中文网

认证0级讲师

reply all(4)
为情所困
var arr =[{"xc_images":"http:\/\/vrjx.zhed.com\/Public\/mht.jpg"},{"xc_images":"http:\/\/vrjx.zhed.com\/Public\/mht.jpg"},{"xc_images":"http:\/\/vrjx.zhed.com\/Public\/lz.jpg"}];
res = arr.map(function(i){return i.xc_images;})
["http://vrjx.zhed.com/Public/mht.jpg", "http://vrjx.zhed.com/Public/mht.jpg", "http://vrjx.zhed.com/Public/lz.jpg"]
女神的闺蜜爱上我
jsonData.map(function (item) { return item.xc_images })
伊谢尔伦
var a = [{"xc_images":"http:\/\/vrjx.zhed.com\/Public\/mht.jpg"},{"xc_images":"http:\/\/vrjx.zhed.com\/Public\/mht.jpg"},{"xc_images":"http:\/\/vrjx.zhed.com\/Public\/lz.jpg"}];

var res = a.map(e => e.xc_images); 

console.log(res); 

扔个三星炸死你

Convert the string into an object and then operate it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!