jquery问题汇总

One:Uncaught SyntaxError: Unexpected token 

$.post('/ajax/validate.do',{"id": id},function(ret){
    //ret
});

返回值明明是json,格式也是正确的,

但是却老是解析不成功,在Google Chrome下报错!

Uncaught SyntaxError: Unexpected token :  

解决方案

$(function(){
    $.post("/ajax/json.do",{'id':id},function(ret){
        //ret;
    }, "json");
});
原文地址:https://www.cnblogs.com/yeanzhi/p/3683019.html