Maison  >  Questions et réponses  >  le corps du texte

javascript - javascipt json en maître de conversion de tableau

[{"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中文网2663 Il y a quelques jours875

répondre à tous(4)je répondrai

  • 为情所困

    为情所困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"]

    répondre
    0
  • 女神的闺蜜爱上我

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

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

    répondre
    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); 

    répondre
    0
  • 扔个三星炸死你

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

    Convertissez la chaîne en objet puis faites-la fonctionner

    répondre
    0
  • Annulerrépondre