简体   繁体   中英

Post/Get handler in Jquery/Javascript

I am doing a web application, which creates a lot of post & get requests.

I can see all the requests using Develop Tools in Mozilla/Chrome, and also in Charles (application).

Is it possible to create a jquery/javascript function which will listen for all requests on current page, and will alert each request to me?

Something similiar to Jquery .click() function.

example:

$('body').post(function() {
alert(this.Url + this.Parameters);
});

I googled, and couldn't find, hope there is a way.

Yes,in Jquery you have Global Ajax Event Handlers

These methods register handlers to be called when certain events, such as initialization or completion, take place for any Ajax request on the page

refer the Documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM