document.addEventListener('pageChange', function(){ //When the change page event fires due to ajax init(); //Call the code again }); /*This stuff listens for an ajax page change*/ window.onload = watch; function watch(){MutationObserver=window.MutationObserver||window.WebKitMutationObserver;var a=new MutationObserver(function(a){for(var b=0;b