ajaxComplete in pure JavaScript

Viewed 11825

I am building a chrome extension using Content Script.

I have a piece of code that injects DOM elements upon success of all ajax request on the page using jQuery. How can you recreate this without jQuery? Please note that I cannot modify any ajax requests on the page.

if(window.jQuery){
jQuery( document ).ajaxComplete(function( event, xhr, settings ) {
    for(var i =0; i< $jq('div.handwave').length; i++){
        if($($('div.handwave')[i]).children('.done').length < 1){
            $(document).find('div.handwave').eq(i).append(wind);
        }
    }
});
}

Is this possible?

1 Answers
Related