zoukankan      html  css  js  c++  java
  • 纯 html 以及 js 多域名跳转


    <!--将以下的 endv.cn 改成要跳转的域名-->
    第一种:单域名的跳转

    1:域名在服务器端跳转

    1 Response.Redirect(http://endv.cn)
    2 Response.End


    2、如果你的域名要在客户端跳转,可以这样:

    <script language="javascript" type="text/javascript">
    window.location="http://endv.cn";;
    </script>
    

      


    3:如果你要让域名页面显示几秒钟之后跳转,可以在html代码的<head></head>部分加上这样的域名跳转代码:
    <meta http-equiv="refresh" content="3; url=http://endv.cn">
    以上三种是也比较常见,比较常用的免费域名跳转代码运行平台Win9x WinNT Win2000 WinME WinXP。
    4:不隐藏域名跳转之后的地址

    1 <html>
    2 <body>
    3 <meta http-equiv="refresh" content="0.1;url=endv.cn">
    4 </body>
    5 </html> 


    5:可隐藏域名跳转之后的地址:

    <html>
    <frameset framespacing="0" border="0" rows="0" frameborder="0">
    <frame name="main" src="endv.cn" scrolling="auto" noresize>
    </frameset>
    </html> 


    6:定时的域名跳转代码

    <meta http-equiv="refresh" content="3;rul=http://endv.cn">


    此代码可以让网页在一定的时间内,跳转到另外一个网页上,其中content=" 为跳转前停暂的秒数,rul= 为跳转的域名

    <meta http-equiv="refresh" content="3;rul=http://endv.cn">


    此代码可以让网页在一定的时间内,跳转到另外一个网页上,其中content=" 为跳转前停暂的秒数,rul= 为跳转的域名。


    第二种:多域名的跳转

    <script>try {if( self.location == "http://cnblogs.com/endv" ) { 
    top.location.href = "http://域名一/目录"; 
    } 
    else if( self.location == "http://域名二/" ) { 
    top.location.href = "http://域名二/目录"; 
    } 
    else if( self.location == "http://域名三/" ) { 
    top.location.href = "http://域名三/目录"; 
    } 
    else if( self.location == "http://域名四/" ) { 
    top.location.href = "http://域名四/目录"; 
    } 
    else {document.write ("错误的访问地址")}} catch(e) {}</script> 

    多域名跳转完整示例:(以下域名看好的可微信扫码…^  ^……)

    <!DOCTYPE HTML>  
    <!-- -头部页面描述:START -->
    <!DOCTYPE html PUBLIC "" "">
    <HTML lang="en">
    <HEAD>
    <META charset="UTF-8"> 
    <TITLE>天云信息</TITLE>
    <script>try {
    /*  ajerp.com  */
    if( self.location == "http://ajerp.com" ) { 
    top.location.href = "/all/";                   // 这里跳转到目录
    } 
    else if( self.location == "http://endv.club/" ) { 
    top.location.href = "/all/"; 
    } 
    else if( self.location == "http://endv.cn/" ) { 
    top.location.href = "https://code.endv.cn/"; 
    } 
    /*  ajerp.com  */
    else if( self.location == "http://endv.top/" ) { 
    top.location.href = "/all/"; 
    } 
    else if( self.location == "http://globaladmin.cn/" ) { 
    top.location.href = "/all/"; 
    } 
    else if( self.location == "http://liulaisheng.cn/" ) { 
    top.location.href = "/all/"; 
    } 
    else if( self.location == "http://suqianbao.cn/" ) { 
    top.location.href = "/all/"; 
    }
    else if( self.location == "https://tianyun.pub/" ) { 
    top.location.href = "/all/"; 
    } 
    else if( self.location == "https://tianyun.space/" ) { 
    top.location.href = "/endv.cn/"; 
    } 
    else  if( self.location == "https://ajerp.com" ) { 
    top.location.href = "https://www.endv.cn/all/";
    }  
    else if( self.location == "https://endv.club/" ) { 
    top.location.href = "https://www.endv.cn/all/";  
    }  
    else if( self.location == "https://endv.cn/" ) { 
    top.location.href = "https://www.endv.cn/all/";  
    }  
    else if( self.location == "https://endv.top/" ) { 
    top.location.href = "./all/";                      
    }
    else if( self.location == "https://globaladmin.cn/" ) { 
    top.location.href = "/all/"; 
    }  
    else if( self.location == "https://liulaisheng.cn/" ) { 
    top.location.href = "/all/"; 
    }  
    else if( self.location == "https://suqianbao.cn/" ) { 
    top.location.href = "/all/"; 
    }  
    else if( self.location == "https://tianyun.pub/" ) { 
    top.location.href = "/all/"; 
    }  
    else if( self.location == "https://tianyun.space/" ) { 
    top.location.href = "/endv.cn/"; 
    }  
    else {
     var str = server.htmlEncode("<p><ahref='https://www.endv.cn'>天云信息</a></p>");
        document.write(str);
    //document.write ("错误的访问地址")
    }
    } catch(e) {}</script> 
    </HEAD> 
    </HTML> 


  • 相关阅读:
    二分查找递归和非递归版
    git常用命令记录
    总结下本周所学的建站流程极其经验
    Ubuntu下su命令失败的解决方法,及其环境变量失效解决
    ubuntu下node安装的三种方法
    Markdown学习及如何在博客园中使用
    nmcli使用方法
    Elasticsearch 升级 7.x 版本后,我感觉掉坑里了!
    Spring Data Elasticsearch基本操作自定义查询
    ElasticSearch——聚合
  • 原文地址:https://www.cnblogs.com/endv/p/7741099.html
Copyright © 2011-2022 走看看