欢迎来到福编程网,本站提供各种互联网专业知识!

用js实现多域名不同文件的调用方法

发布时间:2007-01-12 作者: 来源:转载
复制代码代码如下:varpartnertop="";varpartnerdomain=escape(document.domain);varpartnerurl=escape(document.URL);varpartnerfoot="";varpartnerad_leave="";varpartnerad_search="";switch(partnerdomain){case'www.flashku.com':partnertop="

复制代码 代码如下:varpartnertop="";
varpartnerdomain=escape(document.domain);
varpartnerurl=escape(document.URL);
varpartnerfoot="";
varpartnerad_leave="";
varpartnerad_search="";
switch(partnerdomain){


case'www.flashku.com':
partnertop="/flashku_top.js";
partnerfoot="/foot.js";
partnerad_leave="";
partnerad_search="";
sitealert="0";
break;

case'flash.xixi168.com':
partnertop="http://www.xixi168.com/flash/flashtopjs.js";
partnerfoot="http://www.xixi168.com/flash/flashbootjs.js";
partnerad_leave="";
partnerad_search="";
sitealert="0";
break;

case'www.myflash.cn':
partnertop="http://sys.shanke.cn/ads/myflash/js/myflash_top.js";
partnerfoot="http://sys.shanke.cn/ads/myflash/js/myflash_foot.js";
partnerad_leave="http://sys.shanke.cn/ads/myflash/js/myflash_leave2.js";
partnerad_search="";
sitealert="0";
break;

case'myflash.shanke.cn':
partnertop="http://sys.shanke.cn/ads/myflash/js/myflash_top.js";partnerfoot="http://sys.shanke.cn/ads/myflash/js/myflash_foot.js";partnerad_leave="http://sys.shanke.cn/ads/myflash/js/myflash_leave2.js";partnerad_search="";sitealert="0";break;

case'flash.chinese.com':
partnerfoot="/foot.js";
partnertop="/chinese_top.js";
partnerad_leave="/js/leave.js";
partnerad_search="";
sitealert="0";
break;


case'flash.cdream.net':
partnertop="http://www.cdream.net/inc/flash_top.js";
partnerfoot="http://www.cdream.net/inc/cr.js";
partnerad_leave="";
partnerad_search="";
sitealert="0";
break;

default:
partnertop="/flashku_top.js";
partnerfoot="/foot.js";
partnerad_leave="";
partnerad_search="";
sitealert="1";
break;
}

//document.write(partnerurl);

//以下实现当域为www.flashku.com时候让首页单独调用一个自己的js,当不想要这个功能时可以
//partnerdomain=="www.flashku.com"后面随便写个不存在域名比如www.sohu.com
if(partnerdomain=="www.flashku.com")
{

if(partnerurl=="http%3A//www.flashku.com/index.htm")
{
partnertop="/flashku_top_index.js"
}
if(partnerurl=="http%3A//www.flashku.com")
{
partnertop="/flashku_top_index.js"
}
if(partnerurl=="http%3A//www.flashku.com/")
{
partnertop="/flashku_top_index.js"
}
if(partnerurl=="http%3A//www.flashku.com/headtest.htm")
{
partnertop="/flashku_top_index.js"
}
}
else
{
partnertop=partnertop
}

document.write("");
document.write("");
document.write("");

相关推荐