In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you the relevant knowledge of how to use jQuery.ajaxSetup. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
JQuery.ajaxSetup (options)
Description: set the default value for Ajax requests to be used later
JQuery.ajaxSetup (options)
Options
Type: PlainObject
A "{key: value}" pair used to configure the Ajax request, all options are optional.
For detailed parameters for setting $.ajaxSetup (), see $.ajax ().
All subsequent Ajax calls to any function will use the new setting parameters unless they are called with their respective arguments overloaded with this default value. Until the next call to $.ajaxSetup ().
Note: the settings specified here affect all $.ajax or AJAX-based derived methods, such as calls to $.get (). This can lead to bad behavior because other calls (for example, plug-ins) may want normal default settings. For this reason, we strongly recommend that you do not use this API. Instead, we recommend explicitly setting options or defining a simple plug-in when calling.
For example, we can set the default URL parameter of the server's repeated response in advance:
$.ajaxSetup ({
Url: 'ping.php'
})
Now every Ajax request will automatically use this "ping.php" URL:
$.ajax ({
/ / url not set here; uses ping.php
Data: {'name':' Dan'}
})
Note: global callback functions should use their respective global Ajax event handling methods-.ajaxStart (), .ajaxStop (), .ajaxComplete (), .ajaxError (), .ajaxSuccess (), .ajaxSend ()-setting instead of setting the options object for $.ajaxSetup ().
Example:
Set the default address of the AJAX request to "/ xmlhttp/", disable triggering global AJAX events, and use POST instead of the default GET method. Subsequent AJAX requests no longer set any option parameters.
$.ajaxSetup ({
Url: "/ xmlhttp/"
Global: false
Type: "POST"
})
$.ajax ({data: myData})
These are all the contents of the article "how to use jQuery.ajaxSetup". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to 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.