登鹳雀楼(王之涣)

白日依山尽,黄河入海流。

欲穷千里目,更上一层楼。

">
立诚勿怠,格物致知
It's all about connecting the dots

Ajax methods in jQuery

We can retrieve information from the server without requiring a page refresh by calling one of these Ajax methods.

Issuing requests

Issuing requests
Ajax method Description
$.ajax([url], options) Makes an Ajax request using the provided set of options. This is a low-level method that is often called via other convenience methods.
.load(url, [data], [callback]) Makes an Ajax request to url and places the response into the matched elements.
$.get(url, [data], [callback], [returnType]) Makes an Ajax request to url using the GET method.
$.getJSON(url, [data], [callback]) Makes an Ajax request to url, interpreting the response as a JSON data structure.
$.getScript(url, [callback]) Makes an Ajax request to url, executing the response as JavaScript.
$.post(url, [data], [callback], [returnType]) Makes an Ajax request to url using the POST method.

Request monitoring

Request monitoring
Ajax method Description
.ajaxComplete(handler) Binds handler to be called when any Ajax transaction completes.
.ajaxError(handler) Binds handler to be called when any Ajax transaction completes with an error.
.ajaxSend(handler) Binds handler to be called when any Ajax transaction begins.
.ajaxStart(handler) Binds handler to be called when any Ajax transaction begins, and no others are active.
.ajaxStop(handler) Binds handler to be called when any Ajax transaction ends, and no others are still active.
.ajaxSuccess(handler) Binds handler to be called when any Ajax transaction completes successfully.

Configuration

Configuration
Ajax method Description
$.ajaxSetup(options) Sets default options for all subsequent Ajax transactions.
$.ajaxPrefilter([dataTypes], handler) Modifies the options on each Ajax request before it is processed by $.ajax().
$.ajaxTransport(transportFunction) Defines a new transport mechanism for Ajax transactions.

Utilities

Utilities
Ajax method Description
.serialize() Encodes the values of a set of form controls into a query string.
.serializeArray() Encodes the values of a set of form controls into a JavaScript data structure.
$.param(obj) Encodes an arbitrary object of key-value pairs into a query string.
$.globalEval(code) Evaluates the given JavaScript string in the global context.
$.parseJSON(json) Converts the given JSON string into a JavaScrit object.
$.parseXML(xml) Converts the given XML string into an XML document.
$.parseHTML(html) Converts the given HTML string into a set of DOM elements.
赞(0) 打赏
文章名称:《Ajax methods in jQuery》
文章链接:https://www.orzzone.com/ajax-methods-in-jquery.html
商业联系:yakima.public@gmail.com

本站大部分文章为原创或编译而来,对于本站版权文章,未经许可不得用于商业目的,非商业性转载请以链接形式标注原文出处。
本站内容仅供个人学习交流,不做为任何投资、建议的参考依据,因此产生的问题需自行承担。

评论 抢沙发

大前端WordPress主题 更专业 更方便

支持快讯、专题、百度收录推送、人机验证、多级分类筛选器,适用于垂直站点、科技博客、个人站,扁平化设计、简洁白色、超多功能配置、会员中心、直达链接、文章图片弹窗、自动缩略图等...

去看看

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力提供更多优质内容!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册