', {
async: 'async',
src: url
})
.load(function(){
if(loadFn){
loadFn();
loadFn = null;
}
})
.error(function(jqXHR, textStatus){
/* When script is blocked, textStatus is undefined. */
if(typeof textStatus !== 'undefined'){
return;
}
if(errorFn){
errorFn(jqXHR, textStatus);
errorFn = null;
}
});
(document.body || document.getElementsByTagName('body')[0]).appendChild(script[0]);
}
};
var AdBlockDetectorWorkaround = function(){
/* This is just in case the handler script is blocked by the adblocker */
if(!XenForo.rellect.AdBlockDetector){
console.log('AdBlock detector failed. Trying workaround.');
XenForo.ajax('index.php', {dataType: 'html', AdblockDetector: 1}, function(ajaxData){
if(XenForo.hasTemplateHtml(ajaxData)){
try{
jQuery.globalEval(ajaxData.templateHtml);
}
catch(e){}
}
}, {
error: function(){
console.log('AdBlock detector workaround failed.');
}
});
}
};
XenForo.rellect.AdBlockDetectorParams.loadScript(
'js/rellect/AdblockDetector/handler.min.js?rev=33',
false,
AdBlockDetectorWorkaround
);