stevefenton.co.uk stevefenton.co.uk

AJAX Request Interceptor

This is a little funky script to intercept AJAX requests and raise a simple custom event for everything else in your app to listen to. To use this, you just need to listen for a custom event named `AjaxDetected`. The method, url, and any data is passed in the event detail. document.body.addEventListener('AjaxDetected', function (e) { console.log(e.detail.method, e.detail.url, e.detail.data); }, false); This event is raised by...