jQuery.parseJSON用法
来源:互联网 发布:面向对象的编程语言 编辑:程序博客网 时间:2024/05/16 14:59
<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script> <script type="text/javascript"> $(function () { $.ajax({ type: "post", dataType: "html", url: "Handler1.ashx?a=1", success: function (data, st) { //var dt2 = jQuery.parseJSON(data); var dt3 = eval('(' + data + ')'); //alert(dt2.teacher); alert(dt3.teacher); } }); //var obj = jQuery.parseJSON('{"name":"John"}'); //alert(obj.name === "John"); }) </script>
发现jquery.parseJSON不是很好用,不推荐
public class Handler1 : IHttpHandler { public void ProcessRequest(HttpContext context) { string start = "{\"title\":\"bt\",\"teacher\":\"ls \",\"time\":\"t\",\"student\":\"sdt\"}"; context.Response.Write(start); } public bool IsReusable { get { return false; } } }
有什么错误,欢迎高手指点。
————————————————————————————————————————
结论:Jquery.parseJSON只支持标准的json格式
- jQuery.parseJSON用法
- jQuery.parseJSON用法
- jquery中$.parseJSON()的用法
- JSON.parse(),JSON.stringify(),jQuery.parseJSON()的用法
- JSON.parse(),JSON.stringify(),jQuery.parseJSON()的用法
- JSON.parse(),JSON.stringify(),jQuery.parseJSON()的用法
- jQuery.parseJSON( json )
- jQuery.parseJSON(json)
- jQuery.parseJSON( json )
- jQuery.parseJSON(json)
- jQuery.parseJSON() 函数详解
- jQuery.parseJSON()函数
- jQuery.parseJSON() 函数详解
- jQuery.parseJSON() 函数详解
- jQuery.parseJSON() 函数详解
- jQuery.parseJSON()笔记
- jQuery的parseXML和parseJSON
- JSON.stringify与jQuery.parseJSON
- 如何用SQL查找30天内过生日的人?
- Porting WiFi drivers to Android
- android 文本框输入法控制
- c里面宏定义的一个很有用的符号#
- Java漏洞成黑客目标 微软呼吁用户更新软件
- jQuery.parseJSON用法
- 操作时间(C#dateTime类)
- 重写OnScrollListener实现滚动刷新加载
- 前端网页设计的知识要点(补充~)
- 2011年12月编程语言排行榜:C#快取代C++的第三名
- 【Android学习笔记】ListView使用SimpleAdapter适配器
- 让迅雷下载速度翻十倍
- Mac outlook设置自动回复
- 让自己的软件实现双击打开文件