我是 JSON 新手。我正在尝试使用以下代码从文件中检索 JSON 数据。
$.getJSON("test1.json",function(data){
文件中的数据如下:
{
"Ad": [
{
"ImpUrl": "http:\/\/test.com\/18148682\/385490696\/?_RM_HTML_CALLBACK_=callbackFunction",
"ClkUrl": "http:\/\/test.com\/HomeLending_TDB_HP_B_EN_b000-00-647.html\/446f783068314a6e3232674144484e69?_RM_HTML_CALLBACK_=callbackFunction",
"FileUrl": "http:\/\/test.com\/385490696\/?_RM_HTML_CALLBACK_=callbackFunction",
"Text": " \r\n\r\n \"Great\r\n <\/div> \r\n\r\n\r\n\r\n\r\n\r\n\r\n Great rates, legendary service.\r\n <\/h5>\r\n\r\n\r\n \r\n\r\n <\/a>\r\n A mortgage with all the comforts of home.\r\n <\/li>\r\n \r\n <\/ul>\r\n \r\n Calculate your rates and payment<\/span><\/a>\r\n\r\n \r\n\r\n > Buying a Home? <\/a>
\r\n \r\n> Refinancing?<\/a>\r\n <\/p>\r\n <\/div>\r\n<\/div>",
}
]
}
当我从数据中删除所有“\”和“\n\r”时,它开始进入函数内部,但没有这些。
谢谢,
-Ritesh