$. Post (URL, Params, callback)

Source: Internet
Author: User

$. Post (URL, Params, callback)

Mount a remote page using HTTP POST

Return Value:XMLHttpRequest

Parameters:

    • URL (string): the URL address of the loaded page.
    • Params (MAP): (optional) Key/value pair parameter sent to the server.
    • Callback (function): (optional) function executed when data loading is complete.

Example:

$. Post ("test. cgi ");

Example:

$. Post ("test. cgi", {name: "John", time: "2 "});

Example:

 
$. Post ("test. cgi", function (data) {alert ("data loaded:" + Data );});

Example:

 
$. Post ("test. cgi ", {name:" John ", time:" 2 "}, function (data) {alert (" data loaded: "+ Data );});

$. Post (URL, Params, callback)

Load a remote page using an http post request.

This is an easy way to send a simple POST request to a server without having to use the more complex $. ajax function. it allows a single callback function to be specified that will be executed when the request is complete (and only if the response has
Successful response code). If you need to have both error and success callbacks, you may want to use $. Ajax.

Return Value:XMLHttpRequest
Parameters:

    • URL (string): the URL of the page to load.
    • Params (MAP): (optional) Key/value pairs that will be sent to the server.
    • Callback (function): (optional) a function to be executed whenever the data is loaded successfully.

Example:

$. Post ("test. cgi ");

Example:

 
$. Post ("test. cgi", {name: "John", time: "2 "});

Example:

 
$. Post ("test. cgi", function (data) {alert ("data loaded:" + Data );});

Example:

 
$. Post ("test. cgi ", {name:" John ", time:" 2 "}, function (data) {alert (" data loaded: "+ Data );});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.