In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what's the difference between $.post and $.ajax". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what's the difference between $.post and $.ajax"?
Differences: 1, "$.post" is an easy-to-use high-level implementation, while "$.ajax" is the underlying AJAX implementation of jQuery; 2, "$.post" only deals with the post request function to replace the complex "$.ajax", does not support the execution of functions in case of error, otherwise "$.ajax" must be used.
The operating environment of this tutorial: windows10 system, javascript1.8.5 version, Dell G3 computer.
What is the difference between $.post and $.ajax
Ajax is the underlying AJAX implementation of jQuery, and $.ajax is a general underlying wrapper. After requesting data from $.ajax (), you need to use callback functions, such as beforeSend, error, dataFilter, success, complete, and so on.
Get $.post is an easy-to-use high-level implementation. We use the $.get $.post method, and jQuery automatically encapsulates the call to the underlying $.ajax.
Get only handles the simple GET request function to replace the complex $.ajax, and the callback function can be called when the request is successful. Function execution on error is not supported, otherwise you must use $.ajax.
Post only handles post request functionality to replace the complex $. Ajax. The callback function can be called when the request is successful. Function execution on error is not supported, otherwise you must use $.ajax.
$.get ("test.php", {name: "John", time: "2pm"}) $.get method automatically generates queryString and submits it to the server (name=John&time=2pm) upon request
The data submitted by the $.post method is directly similar to a form submission, with a larger amount of data submitted than $.get.
The difference is that get and post further encapsulate ajax, and the effect is exactly the same as the ajax execution type of get or post
The reason why get post does this is to facilitate development, so you don't have to write ajax url scuess every time.
The problems that can be solved by get and post can be solved by ajax, and ajax is more flexible.
Thank you for your reading. The above is the content of "what's the difference between $.post and $.ajax". After studying this article, I believe you have a deeper understanding of the difference between $.post and $.ajax. the specific use still needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.