I want to develop a chrome extension that replace some text on facebook but once the user scroll the ajax appear, so the newly ajax loaded text doesn't get change. I tried on() to bind but failed. So I'm thinking every time if there is ajax I fire my event again.
But I can't find any method to detect an ajax happened in a page using jquery :(
I tried
$('body').on(function(){
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
/* special ajax here */
alert('test');
}
});
not working