0

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.

1 Answer 1

4

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

Sign up to request clarification or add additional context in comments.

2 Comments

if the request is not made by jquery, and is a javascript request, will it be called, or no?
@RuslanDascal: No, it won't.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.