In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you what are the parameters of the post method in jquery, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The parameters of the jquery post method are: 1, URL, which specifies which URL to send the request to; 2, data, which specifies the data sent to the server with the request; 3, function (), which specifies the function to run when the request is successful; and 4, dataType, which specifies the data type of the expected server response.
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
The post () method uses the HTTP POST request to load data from the server.
Syntax:
$(selector) .post (URL,data,function (data,status,xhr), dataType)
The post () method supports four parameters:
Parameter description URL is required. Specifies which URL to send the request to. Data is optional. Specifies the data to be sent to the server with the request. Function (data,status,xhr) is optional. Specifies the function to run when the request is successful.
Additional parameters:
Data-contains the result data from the request
Status-contains the status of the request ("success", "notmodified", "error", "timeout", "parsererror")
Xhr-contains XMLHttpRequest objects
DataType is optional. Specifies the data type of the expected server response.
By default, jQuery determines intelligently.
Possible types:
"xml"-an XML document
"html"-HTML as plain text
"text"-plain text string
"script"-runs the response in JavaScript and returns in plain text
"json"-runs the response as JSON and returns as a JavaScript object
"jsonp"-load a JSON block using JSONP and will add a "? callback=?" Go to URL to specify callback.
Example:
$(document) .ready (function () {$("button") .click (function () {$.post ("/ try/ajax/demo_test_post.php", {name: ", url:" https://www.yisu.com/"}, function (data) Status) {alert ("data:\ n" + data + "\ n status:" + status) }); send a HTTP POST request page and get the return content above are all the contents of the article "what are the parameters of the post method in jquery". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.