gpt4 book ai didi

javascript - 为什么我无法将这个 json 转换为字符串?

转载 作者:行者123 更新时间:2023-11-28 11:35:22 25 4
gpt4 key购买 nike

我有 json 数据,但很难将其转换为字符串。如何格式化它才能成为字符串?

jsfiddle:http://jsfiddle.net/s97QX/2/

代码:

Jsonvar = {"shows":[{"show_id":6387, "shownum":6387,"title":"The Protestant's  Dilemma","guest":"Devin Rose","category":"Non-Catholic","url":"http://www.catholic.com/radio/shows/the-protestants-dilemma-11565","audiourl":"http://www.catholic.com/sites /default/files/audio/radioshows/ca140331b.mp3","datetime":"1396317600","description":"
Devin Rose <\/p>","thumbnailsmall":"http://www.catholic.com/sites/default/files/imagecache/profile_square_small/images/profilepics/a109aad8daa70ad8976ffc.L._V387899120_SX200_.jpg","thumbnaillarge":"http://www.catholic.com/sites/default/files/imagecache/profile_square_large/images/profilepics /a109aad8daa70ad8976ffc.L._V387899120_SX200_.jpg"}]};

var jsonstr=JSON.stringify(Jsonvar);
alert(jsonstr);

最佳答案

Invalid JSON

首先,您使用 jsonlint 验证您的 json。 JSONLINT 然后尝试。

关于javascript - 为什么我无法将这个 json 转换为字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23054103/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com