何时使用ajax.load()或jquery.ajax()[复制]

时间:2022-04-10 22:36:17

This question already has an answer here:

这个问题在这里已有答案:

I am little confused about in what scenario Ajax.load() method is used and what scenario jQuery.ajax() is used.

我对使用Ajax.load()方法以及使用jQuery.ajax()的场景感到困惑。

There are many AJAX method, I am mainly confused between ajax.load() and simple ajax

有很多AJAX方法,我主要是在ajax.load()和简单的ajax之间混淆

1 个解决方案

#1


0  

The load function is specifically used for loading in content from another page, into an element on your current page.

加载函数专门用于将内容从另一个页面加载到当前页面的元素中。

The other two functions are general-ajax functions that jQuery provides. Also, .get() is just shorthand for sending a $_GET request via AJAX.

另外两个函数是jQuery提供的general-ajax函数。另外,.get()只是通过AJAX发送$ _GET请求的简写。

#1


0  

The load function is specifically used for loading in content from another page, into an element on your current page.

加载函数专门用于将内容从另一个页面加载到当前页面的元素中。

The other two functions are general-ajax functions that jQuery provides. Also, .get() is just shorthand for sending a $_GET request via AJAX.

另外两个函数是jQuery提供的general-ajax函数。另外,.get()只是通过AJAX发送$ _GET请求的简写。