Ajax($.getJSON使用实例)
2013-03-05 11:36
288 查看
<script type="text/javascript"> function pageIndexChanged() { var url = "/OrderList/Lists"; var where = ""; @*location.href = "@this.Url.Action("List")?pageindex=" + $("#pager").pager("pageindex") + "&pagesize=" + $("#pager").pager("pagesize") + "&where=" + escape(where);*@ var pageindex = $("#pager").pager("pageindex"); var pagesize = $("#pager").pager("pagesize"); where = escape(where); $.getJSON(url, { where: where, pageindex: pageindex, pagesize: pagesize }, function (data) { alert(data.total); alert(data.rows[0].Order.OrderID); alert(data.PageIndex); alert(data.PageSize); }); } $(function () { $("#order-details-search").click(function () { $(".detail-search").show(100); }); $("#detail_search_cancle").click(function () { $(".detail-search").hide(100); }) }); </script>
var cache = {}; var data; $("#seachers").autocomplete( { source: function (request, response) { var term = request.term; if (term in cache) { data = cache[term]; response($.map(data.NameList, function (item) { return { label: item.ProjectName }; })); } else { $.ajax({ url: "@this.Url.Action("AutoGet", "Project")", dateType: "jsonp", data: { top: 10, key: request.term }, success: function (data) { if (data.NameList.length) { cache[term] = data; response($.map(data.NameList, function (item) { return { label: item.ProjectName }; })); } } }); } }, minLength: 1, autoFocus: false, delay: 500 });
相关文章推荐
- Ajax($.getJSON使用实例)
- PHP 使用 getJSON 实例 ajax
- $.get(),$.ajax(),$.getJSON()代码中简单使用
- jQuery内置的AJAX功能和JSON的使用实例
- 使用$.getJSON实现跨域ajax请求
- SpringMVC中使用Ajax POST请求以json格式传递参数服务端通过request.getParameter("name")无法获取参数值问题分析
- ajax提交json数据并使用Springmvc接收实例
- struts2 + ajax + json的结合使用,实例讲解
- 使用$.getJSON实现跨域ajax请求
- 怎么使用jquery的ajax和getJSON函数连接Declicious网站获得漂亮书签的个数
- 使用 ajax json(getJSON)从服务器读取数据,在IE下不更新问题解决
- jQuery中ajax的使用和缓存问题解决 $getjson 与$get都会被IE缓存
- AJAX请求 $.getJson方法的使用
- SpringMVC中使用Ajax POST请求以json格式传递参数服务端通过request.getParameter("name")无法获取参数值问题分析
- JS与Ajax Get和Post在使用上的区别实例详解
- 前端使用Jquery的getJSON方法,后台使用PHP,解决IE和火狐Firefox中存在的跨域ajax请求问题。
- struts2 + ajax + json的结合使用,实例讲解
- 使用JSON-RPC for java(AJAX)实例
- 使用$.getJSON实现跨域ajax请求
- jQuery内置的AJAX功能和JSON的使用实例