Skip to content

Instantly share code, notes, and snippets.

@os0x
Created October 22, 2009 07:34
Show Gist options
  • Save os0x/215813 to your computer and use it in GitHub Desktop.
Save os0x/215813 to your computer and use it in GitHub Desktop.
function insertSITEINFO(callback,thisObject){
var isPageLoaded = false, isSiteinfoLoaded = false, Siteinfo;
document.addEventListener('DOMContentLoaded',function(){
isPageLoaded = true;
if (isSiteinfoLoaded) {
callback.call(thisObject, Siteinfo);
Siteinfo = window.AutoPagerizeCallbackSiteinfo = null;
}
},false);
var src = 'http://ss-o.net/json/wedataAutoPagerizeSITEINFO.js';
if (Set.DISABLE_IFRAME && window.parent !== window) return;
var sc = document.createElementNS(HTML_NAMESPACE, 'script');
sc.type = 'text/javascript';
window.AutoPagerizeCallbackSiteinfo = function(res){
isSiteinfoLoaded = true;
if (isPageLoaded) {
callback.call(thisObject,res);
window.AutoPagerizeCallbackSiteinfo = null;
} else {
Siteinfo = res;
}
};
sc.src = src;
(document.body || document.documentElement).appendChild(sc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment