我正在 ajaxing 一个页面,成功后我有以下代码:
success: function(html){
var product_json = [];
data=$(html);
$(".product_json", data).each(function(){
product_json.push( jQuery.parseJSON( $(this).html() ) );
});
....
//code continue
我的 Json 看起来像:
{
"item_logoagenzia": "/resource/loghi/medium/13.gif",
"item_description": "Some Bernini ven.."
}
如果我有一些像双引号这样的字符它停止工作,它工作正常。
错误 Json 看起来像:
{
"item_logoagenzia": "/resource/loghi/medium/13.gif",
"item_description": "Some "Bernini" ven.."
}
我无法控制 json 创建。如何修改它或删除上面给出的脚本中的双引号等特殊字符?