我是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 \ n”数据时,它开始进入函数内部,但是没有这些。< / p>
谢谢,
-Ritesh
答案 0 :(得分:0)
Ritesh您的JSON数据格式不正确,请检查“结束并结束。我看到附近有一个额外的引用”很棒。