Home >Web Front-end >JS Tutorial >What is the difference between .post and .ajax in jquery

What is the difference between .post and .ajax in jquery

coldplay.xixi
coldplay.xixiOriginal
2020-12-17 10:48:081673browse

The difference between .post and .ajax in jquery is that the bottom layer of [.post] is implemented by [.ajax]. The two have a parent-child relationship, and the code is [post: function( url, data, callback, type ) {if (jQuery...].

What is the difference between .post and .ajax in jquery

The operating environment of this tutorial: windows7 system, jquery3.2.1 version, this method is suitable for all brands of computers.

Recommendation: jquery video tutorial

The difference between .post and .ajax in jquery is .postThe bottom layer consists of .ajax Implemented.

.post source code:

post: function( url, data, callback, type ) {
    if ( jQuery.isFunction( data ) ) {
        callback = data;
        data = {};
    }
    return jQuery.ajax({
        type: "POST",
        url: url,
        data: data,
        success: callback,
        dataType: type
    });
},

Related free learning recommendations: javascript (video)

The above is the detailed content of What is the difference between .post and .ajax in jquery. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn