$.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");
});

jquery使用ajax报错[Uncaught SyntaxError: Unexpected token :]的更多相关文章

  1. vue - public 引入 <script>报错 Uncaught SyntaxError: Unexpected token '<'

    1.现象 原本我是直接在母版引入 <script type="application/javascript" src="static/config.js" ...

  2. 打开了chrome审查元素 发现报错 Uncaught SyntaxError: Unexpected token )

    这个错误并不影响业务处理,但是看到有报错,心里总是不爽. 经过几番查找,发现了原因. <a href="javascript:void()" oncick="onS ...

  3. vue项目npm run dev 报错Uncaught SyntaxError: Unexpected token <

    目前代码所处位置是micro分支,该分支是从dev分支直接拉下来进行npm run dev的,而dev分支是可以正常运行的,网上的诸多解释是babel转义时候报错,其实对比可见,两个分支不同的地方应该 ...

  4. 后台返回json字符串 页面js报错 Uncaught SyntaxError: Unexpected identifier

    后台json字符串是 [{"name": "报销申请", "id": "start"}, {"name&quo ...

  5. HTML5 plus 报错 Uncaught SyntaxError: Unexpected identifier at XXXX.html:1

    最近使用 VUE2.X + muse-ui  + HTML5 plus 开发webApp 调用HTML5 plus报错,错误提示如下 Uncaught SyntaxError: Unexpected ...

  6. chrome js报错Uncaught SyntaxError: Unexpected string

    个人博客 地址:http://www.wenhaofan.com/article/20180912123136 js报错,最后发现是$(function(){})这部分()不完整 $(function ...

  7. chrome查看js报错Uncaught SyntaxError: Unexpected string

    个人博客原文http://wenhaofan.com/article/20180912123136 js报错,最后发现是$(function(){})这部分()不完整 $(function({ $(& ...

  8. 页面报错Uncaught SyntaxError: Unexpected identifier

    错误描述:未捕获的语法错误:意想不到的标识符. 如图所示:检查之后发现是页面js内缺少“,”引起的.添加之后就OK了.

  9. Thinkphp中js报错,Uncaught SyntaxError: Unexpected token }

    tp中js在行末使用注释报错Uncaught SyntaxError: Unexpected token } if (new_directors==1) {// 注释 解决办法:注释换成单行 if ( ...

随机推荐

  1. JFR 与 JProfilter Jvmisualvm

    只有JFR 是可以在生产环境使用  采用C++独立写的采样手机功能 而 JProfilter/JVisualvm 都只能在测试环境下使用 使用instrument 机制 ,还有debug 框架 最早是 ...

  2. Fb,tw等emoji相关

    最近处理fb  emoji,查了下相关的资料.记录于此 twitter blog 关于:https://blog.twitter.com/developer/en_us/a/2014/open-sou ...

  3. Windows2008 IIS + .NET环境搭建指南

    Windows下最常用的网页服务器是自带的IIS,这里将为大家演示,windows2008下如何搭建IIS + .NET的动态网页环境. 环境配置:Qcloud 云服务器 windows 200864 ...

  4. org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException

    使用Intelij Idea时,报错如下: org.apache.catalina.core.StandardContext.listenerStart Error configuring appli ...

  5. input限制数字输入

    onkeyup="this.value=this.value.replace(/\D/g,'')"

  6. 149. Max Points on a Line (Array; Greedy)

    Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. ...

  7. time,datetime,时间戳 时间格式转换

    总结: time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) datetime.datetime.now().strftime( ...

  8. 15-matlab矩阵运用

    from scipy.spatial import Delaunay from mpl_toolkits.mplot3d import Axes3D import numpy as np import ...

  9. linq to sql之like

    contains——like '%提交%' StartsWith—— like '条件%' EndWith——like '%条件'

  10. linux下nginx tomcat集群

    集群系统一般通过两台或多台节点服务器系统通过相应的硬件及软件互连,每个群集节点都是运行其自己进程的独立服务器. 这些进程可以彼此通信,对网络客户机来说就像是形成了一个单一系统,协同起来向用户提供应用程 ...