您的位置:首页 > Web前端 > JQuery

jquery使用ajax报错[Uncaught SyntaxError: Unexpected token :]

2014-03-20 00:40 387 查看
$.post('/ajax/validate.do',{"id": id},function(ret){
//ret
});


返回值明明是json,格式也是正确的,却解析不成功,在Google Chrome下报错——Uncaught SyntaxError: Unexpected token :
http://stackoverflow.com/questions/3143698/uncaught-syntaxerror-unexpected-token
解决方法:

$(function(){
$.post("/ajax/json.do",{'id':id},function(ret){
//ret;
}, "json");
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐