Using javascript to call multiple domain names and different files _ javascript skills

Source: Internet
Author: User
How to call multiple domain names and different files using js The Code is as follows:

Var partnertop = "";
Var partnerdomain = escape (document. domain );
Var partnerurl = escape (document. URL );
Var partnerfoot = "";
Var partnerad_leave = "";
Var partnerad_search = "";
Switch (partnerdomain ){


Case 'www .flashku.com ':
Partnertop = "/flashku_top.js? 1.1.20 ";
Partnerfoot = "/foot. js? 1.1.20 ";
Partnerad_leave = "";
Partnerad_search = "";
Sitealert = "0 ";
Break;

Case 'Flash .xixi168.com ':
Partnertop = "http://www.xixi168.com/flash/flashtopjs.js? 1.1.20 ";
Partnerfoot = "http://www.xixi168.com/flash/flashbootjs.js? 1.1.20 ";
Partnerad_leave = "";
Partnerad_search = "";
Sitealert = "0 ";
Break;

Case 'www .myflash.cn ':
Partnertop = "http://sys.shanke.cn/ads/myflash/js/myflash_top.js? 1.1.20 ";
Partnerfoot = "http://sys.shanke.cn/ads/myflash/js/myflash_foot.js? 1.1.20 ";
Partnerad_leave = "http://sys.shanke.cn/ads/myflash/js/myflash_leave2.js? 1.1.20 ";
Partnerad_search = "";
Sitealert = "0 ";
Break;

Case 'myflash .shanke.cn ':
Partnertop = "http://sys.shanke.cn/ads/myflash/js/myflash_top.js? 1.1.20 "; partnerfoot =" http://sys.shanke.cn/ads/myflash/js/myflash_foot.js? 1.1.20 "; partnerad_leave =" http://sys.shanke.cn/ads/myflash/js/myflash_leave2.js? 1.1.20 "; partnerad_search =" "; sitealert =" 0 "; break;

Case 'Flash .chinese.com ':
Partnerfoot = "/foot. js? 1.1.20 ";
Partnertop = "/chinese_top.js? 1.1.20 ";
Partnerad_leave = "/js/leave. js? 1.1.20 ";
Partnerad_search = "";
Sitealert = "0 ";
Break;


Case 'Flash .cdream.net ':
Partnertop = "http://www.cdream.net/inc/flash_top.js? 1.1.20 ";
Partnerfoot = "http://www.cdream.net/inc/cr.js? 1.1.20 ";
Partnerad_leave = "";
Partnerad_search = "";
Sitealert = "0 ";
Break;

Default:
Partnertop = "/flashku_top.js? 1.1.20 ";
Partnerfoot = "/foot. js? 1.1.20 ";
Partnerad_leave = "";
Partnerad_search = "";
Sitealert = "1 ";
Break;
}

// Document. write (partnerurl );

// The following implementation allows the homepage to call its own js when the domain is www.flashku.com. If you do not want this function, you can
// Partnerdomain = "www.flashku.com" followed by a nonexistent domain name such as www.sohu.com
If (partnerdomain = "www.flashku.com ")
{

If (partnerurl = "http % 3A // www.flashku.com/index.htm ")
{
Partnertop = "/flashku_top_index.js? 1.1.20"
}
If (partnerurl = "http % 3A // www.flashku.com ")
{
Partnertop = "/flashku_top_index.js? 1.1.20"
}
If (partnerurl = "http % 3A // www.flashku.com /")
{
Partnertop = "/flashku_top_index.js? 1.1.20"
}
If (partnerurl = "http % 3A // www.flashku.com/headtest.htm ")
{
Partnertop = "/flashku_top_index.js? 1.1.20"
}
}
Else
{
Partnertop = partnertop
}



Document. write (" ");
Document. write (" ");
Document. write (" ");

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.