Closed. This question is off-topic。它当前不接受答案。
                            
                        
                    
                
            
                    
                
                        
                            
                        
                    
                        
                            想改善这个问题吗? Update the question,所以它是on-topic,用于堆栈溢出。
                        
                        5年前关闭。
                    
                
        

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

最佳答案

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

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

10-11 12:26