How to intercept a site http request using javascript?

events, http, javascript

Solution

jQuery:

$("link, script, style, a, img").each(function(){
    $(this).load(function(){
        // do stuff when each of these elements is loaded
    });
});

Not entirely sure if that is what you want, as your question isn't terribly clear, but that is how you can bind something to the load event for each of those element types.

Problem

I need to hook all links, images, css and js call URLs inside my site and execute some operation when an event occurs with then. Anybody knows how to handle all these events?

Original source