I have a web application. Is it possible for my app to monitor all outgoing client browser HTTP requests that originate from my app? If it is, is it possible to intercept them and cancel them at will? Is there a JQuery HTTP interceptor, in particular?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This is possible with JQuery using ajaxSetup.beforeSend
$.ajaxSetup({
beforeSend: function(xhr) {
//do your stuff here
}
});