Home >Web Front-end >JS Tutorial >Simple example of $.post() method in jquery_jquery
There is such a method in jqery, $.post() Here is a simple example of this method:
jQuery.post( url, [data], [callback], [type] ):
Use POST method to make asynchronous requests
Parameters:
url (String): The URL address to send the request.
data (Map) : (optional) The data to be sent to the server, expressed in the form of Key/value pairs.
callback (Function) : (optional) Callback function when loading is successful (this method is called only when the return status of Response is success).
type (String) : (Optional) The official description is: Type of data to be sent. In fact, it should be the type requested by the client (JSON, XML, etc.)
1.html page (index.html)
//echo $email;
//echo $address;
echo "success";
?>