AJAX jQuery.load与jQuery.get [英] AJAX jQuery.load versus jQuery.get

查看:180
本文介绍了AJAX jQuery.load与jQuery.get的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在应负载(网址,数据,回调),可用于对jQuery.get(网址,数据,回调,类型)方法时,使AJAX使用jQuery调用?

When should the load( url, data, callback ) method be used versus jQuery.get( url, data, callback, type ) when making AJAX calls with jQuery?

推荐答案

首先,这两个功能是完全不同的。在加载功能适用于选择器和加载所选组内AJAX调用的结果,回调是处理呼叫的的onComplete事件;而$不用彷徨功能就比较一般了,并且回调处理AJAX调用,您可以自由定义任何你想要的行为的成功响应。而且你可以通过查看jQuery框架的文件和规范的找到所有这些信息。

First of all those two functions are completely different. The 'load' function works with selectors and loads the result of AJAX call inside the selected group and the callback is to handle the "oncomplete" event of the call; while the $.get function is more general and the callback handles the success response of AJAX call where you are free to define any behavior you want. And you can find all this information just by looking at the documentation and specification of the jQuery framework.

这里你可以找到一个很好的文档。

Here you can find a good documentation.

这篇关于AJAX jQuery.load与jQuery.get的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆