search

Home  >  Q&A  >  body text

javascript - javascipt json to array conversion master

[{"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中文网2709 days ago908

reply all(4)I'll reply

  • 为情所困

    为情所困2017-07-05 11:05:13

    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"]

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-07-05 11:05:13

    jsonData.map(function (item) { return item.xc_images })

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-07-05 11:05:13

    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); 

    reply
    0
  • 扔个三星炸死你

    扔个三星炸死你2017-07-05 11:05:13

    Convert the string into an object and then operate it

    reply
    0
  • Cancelreply