zoukankan      html  css  js  c++  java
  • 网站跳转代码的实现途径

    第一种:
    如果你要让域名页面显示几秒钟之后跳转,可以在html代码的<head></head>部分加上这样的域名跳转代码:
    <meta http-equiv="refresh" content="3; url=http://将这里改成要跳转的域名">

    第二种:
    不隐藏域名跳转之后的地址
    <html>
    <body>
    <meta http-equiv="refresh" content="0.1;url=将这里改成要跳转的域名">
    </body>
    </html>

    第三种:
    可隐藏域名跳转之后的地址:
    <html>
    <frameset framespacing="0" border="0" rows="0" frameborder="0">
    <frame name="main" src="将这里改成要跳转的域名" scrolling="auto" noresize>
    </frameset>
    </html>

    第四种:
    定时的域名跳转代码
    <meta http-equiv="refresh" content="3;rul=http://将这里改成要跳转的域名">
    此代码可以让网页在一定的时间内,跳转到另外一个网页上,其中content=" 为跳转前停暂的秒数,rul= 为跳转的域名

    第五种:
    如果你的域名要在客户端跳转,可以这样:<script language="javascript" type="text/javascript">window.location="http://将这里改成要跳转的域名";;</script>

    第六种:
    域名在服务器端跳转Response.Redirect(http://将这里改成要跳转的域名)Response.End

    第七种:

    放在body的里面

    <script language="javascript">window.location.href= 'https://www.hsgjyl.com/';</script>

    第八种

    PC端与WAP移动端的识别

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>PC端与手持移动端的识别</title>
    <script type="text/javascript">
    function browserRedirect() {
        var sUserAgent = navigator.userAgent.toLowerCase();
        var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
        var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
        var bIsMidp = sUserAgent.match(/midp/i) == "midp";
        var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
        var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
        var bIsAndroid = sUserAgent.match(/android/i) == "android";
        var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
        var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
       
        if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
           window.location.href=https://m.baidu.com;//输入移动端网址
        } else {
           window.location.href="https://www.baidu.com"; //输入PC端网址
        }  
    }
    browserRedirect();
    
    </script>
    </head>
    <body>
    </body>
    </html>
    夫君子之行,静以修身,俭以养德。非淡泊无以明志,非宁静无以致远。夫学须静也,才须学也,非学无以广才,非志无以成学。慆慢则不能励精,险躁则不能冶性。年与时驰,意与日去,遂成枯落,多不接世,悲守穷庐,将复何及!
  • 相关阅读:
    ASP.NET编程的十大技巧
    C#学习心得(转)
    POJ 1177 Picture (线段树)
    POJ 3067 Japan (树状数组)
    POJ 2828 Buy Tickets (线段树)
    POJ 1195 Mobile phones (二维树状数组)
    HDU 4235 Flowers (线段树)
    POJ 2886 Who Gets the Most Candies? (线段树)
    POJ 2418 Cows (树状数组)
    HDU 4339 Query (线段树)
  • 原文地址:https://www.cnblogs.com/lzg9/p/6812081.html
Copyright © 2011-2022 走看看