What's the use of jQuery.ajaxPrefilter?
This article mainly introduces the use of jQuery.ajaxPrefilter, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
JQuery.ajaxPrefilter ([dataTypes], handler (options, originalOptions, jqXHR))
Description: sent before each request and processed by $. Ajax () before they are processed, set custom Ajax options or modify existing options.
DataTypes
Type: String
An optional string containing one or more space-separated data types
Handler (options, originalOptions, jqXHR)
Type: Function ()
A handler that sets the default value for future Ajax requests.
Register a typical pre-filter that uses $.ajaxPrefilter (), which looks like this:
$.ajaxPrefilter (function (options, originalOptions, jqXHR) {
/ / Modify options, control originalOptions, store jqXHR, etc
})
Thank you for reading this article carefully. I hope the article "what's the use of jQuery.ajaxPrefilter" shared by the editor will be helpful to everyone? at the same time, I also hope that you will support and pay attention to the industry information channel, and more related knowledge is waiting for you to learn!