导航:首页 > 编程语言 > 网页页面跳转代码

网页页面跳转代码

发布时间:2023-03-24 06:37:37

① html点击一个按钮,跳转到当前页面的另一个指定位置!这样的代码怎么写

建设网站时,经常会遇到需要跳转页面的情况,例如我们的网站分中英文版本,网站程序索引页不是直接放在根目录下,而是分别放在“en”和“cn“目录中区分中英版本。

打开网站时,想直接跳转到en目录访问英文版,则需要使用跳转代码跳转后方可以访问。通过html代码跳转页面的详细步骤:

1、打开Dreamweaver,新建html页面;

② 页面直接跳转代码

跳转代码有很多啊,他可能只是放在网站的一个文件夹下面的,所以你输入网站的时候是不会跳转的,
稍微改了下,不知道符不符合你的要求,颜色可自拟
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>5秒后跳转到另一个页面</title>
</head>
<script>
var t = 5;
var s = '.';
timeID=setInterval("countDown()",1000);
function countDown(){
time.innerHTML= t +"秒后跳转"+s;
t--;
s+='.';
if (t==0) {
location.href="http://www.tc345.cn/"; //【要跳转的网站】
clearInterval(timeID);
}
}
</script>
<body>

<div><font ID="time" face="impact" color="#272822" size="7">即将跳转</font>
</div>
</body>
</html>
比如把这段代码放到一个文件夹下面,把文件夹命名为数字或者字母,然后放在网站更目录下就可以啦,很简单的。

③ 网页自动跳转代码

这个是5秒之后跳转的代码,时间可以自己改
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>5秒后跳转到内另一个页面</title>
</head>
<script>
var t = 5;
var s = '.';
timeID=setInterval("countDown()",1000);
function countDown(){
time.innerHTML= t +"秒后跳转"+s;
t--;
s+='.';
if (t==0) {
location.href="http://www.51zuoyi.com/"; //【这边是要容跳转的目标地址】
clearInterval(timeID);
}
}
</script>
<body>

<div><font ID="time" face="impact" color="#272822" size="7">即将跳转</font>
</div>
</body>
</html>
直接修改为自己想要的跳转地址就可以了

④ 总结PHP中几种常用的网页跳转代码

网页跳转的意思就是指当你在浏览器中访问A页面时,会自动跳转到B页面,往往网页跳转用在404页面中会比较多点。至于怎么实现网页跳转,网上已经提供了很多的方法,有些方法是不可行的,经过测试,叶德华今天就在这里提供PHP中常用的几种网页跳转代码,其中有些方法并不只是适用于PHP,也可以经过相应的修改应用到其他地方。
工具/原料
php脚本语言、html标签语言、javascript脚本语言
方法/步骤
1
使用header()函数
在php页面的最开头输入如下代码:
<?php

?>
那么,我们命名为1.php,当访问1.php的时候,就会自动跳转到www.yedward.net页面,这里需要强调的是,使用该种方法,必须要将这行代码写在最前面,如果不想写在前面,我会在后面提供另一种方法。

2
使用meta来实现跳转
在php页面或者是html页面的头部输入如下代码:
<meta http-equiv=”refresh” content=”5;url=www..com”>;
那么,我们将页面命名为2.php或3.htm,当访问2.php或3.htm的时候,就会自动跳转到www..com这个页面,注意,content中的数字5的意思是经过多久开始跳转,这里设置的是5就是说要经过5秒钟该页面才会跳转到目标页面,建议大家在设置跳转时间的时候不要超过10秒。

⑤ 怎么跳转网页

问题一:怎么让网站跳转到另一个网站 一般来说,网站的默认欢迎页面是index名称的页面,例如index,index,index.asp,index.jsp等可以试试看在你的根目录放一个index文件,在下面写window.location.href= '要跳转的地址';</script>

问题二:怎么跳转网页 1、首先打开ie浏览器。点击菜单栏上的“工具”按钮,从弹出的菜单中选择“Internet选项”;2、从弹出的“备蚂明Internet选项”对话框中选择“安全”选项卡,并在“选择要查看的区域或更改安全设置”下方的窗口中选中“Internet”,单击下方的“自定义级别”按钮;3、在新弹出的对话框中向下滚动找到如图所示的位置,并按图示进行选择。这两个安全设置分别对应了禁止源网站使用meta refresh和javascript来禁止框架引用并强制跳转回其网站的功能。保存退出。

问题三:如何跳转到上一个页面 要实现从一个页面A跳到另一个页面B,js实现就在A的js代码加跳转代码
JS跳转大概有以下几种方式:
第一种:(跳转到b)

window.location.href=b;

第二种:(返回上一页面)

window.history.back(-1);

第三种:

window.navigate(b);

第四种:

self.location=’b’;

第五种:

top.location=’b’;

问题四:网页制作中怎么让网页跳转回到首页? 10分 meta-refresh可以实现预定时间跳网络
再从网络跳回来的话应该加个定时器还是可以的,貌似需要框架吧~

问题五:如何用jquery实仿告现页面跳转 例:;
点击图片事件
$(img).click(function(){
点击图片后发送跳转到指定页面的事件。
window.location.href=输入另一个页面的链接;

问题六:javascript怎么跳转页面 js实现页面的跳转具体有几种方法,下面列出几种,供你参考:
1、 window.location.href方式
window.location.href=target.aspx;
2、 window.navigate方式物卖跳转
window.navigate(target.aspx);

3、window.loction.replace方式实现页面跳转,注意跟第一种方式的区别
window.location.replace(target.aspx);
有3个jsp页面(1.aspx, 2.aspx, 3.aspx),进系统默认的是1.aspx,当我进入2.aspx的时候, 2.aspx里面用window.location.replace(3.aspx);
与用window.location.href (3.aspx);
从用户界面来看是没有什么区别的,但是当3.aspx页面有一个返回按钮,调用window.history.go(-1); wondow.history.back();方法的时候,一点这个返回按钮就要返回2.aspx页面的话,区别就出来了,当用 window.location.replace(3.aspx);连到3.aspx页面的话,3.aspx页面中的调用 window.history.go(-1);wondow.history.back();方法是不好用的,会返回到1.aspx。
4、self.location方式实现页面跳转,和下面的top.location有小小区别
self.location='target.aspx';
5、top.location

top.location='target.aspx';

谢谢!

问题七:制作的网站页面怎么跳转到另一个页面 新闻 这两个字的容器前面加上
如下代码:
新闻
@代表你想要跳转的页面名称。

问题八:html submi按钮怎样实现页面跳转 ]@]@]
@关键加上这一句 onclick=javascript:location.href=''

问题九:用JavaScript怎么实现页面跳转 第一种:

window.location.href=login.jsp?backurl=+window.location.href;

第二种:

alert(返回);
window.history.back(-1);

第三种:

window.navigate(top.jsp);

第四种:

self.location='top';

第五种:

alert(非法访问!);
top.location='xx.jsp';

问题十:HTML中有一个button,如何让它点击后跳转到指定页面或动作 在按钮外面扩一个a标签就好了

⑥ html+css做一个完整的可以跳转的网页

一、常规的JS页面跳转代码
1、在原来的窗体中直接跳转用
<script type="text/javascript">
window.location.href="你所要跳转的页面";
</script>
2、在新窗体中打开页面用:
<script type="text/javascript">
window.open('你所要跳转的页面');
</script>
3、JS页面跳转参数的注解
<SCRIPT LANGUAGE="javascript">
<!--
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
//写成一行
-->
</SCRIPT>
参数解释:
<SCRIPT LANGUAGE="javascript"> js脚本开始;
window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空'代替;
height=100 窗口高度;
width=500 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值。
二、跳转指定页面的JS代码
第1种:
<script language="javascript" type="text/javascript">
window.location.href="login.jsp?backurl="+window.location.href;
</script>
第2种:
<script language="javascript">
alert("返回");
window.history.back(-1);
</script>
第3种:
<script language="javascript">
window.navigate("top.jsp");
</script>
第4种:
<script language="JavaScript">
self.location=’top.htm’;
</script>
第5种:
<script language="javascript">
alert("非法访问!");
top.location=’xx.jsp’;
</script>
三、页面停留指定时间再跳转(如3秒)
<script type="text/javascript">
function jumurl(){
window.location.href = 'http://www.mahaixiang.cn/';
}
setTimeout(jumurl,3000);
</script>
四、根据访客来源跳转的JS代码
1、JS判断来路代码
此段代码主要用于网络谷歌点击进入跳转,直接打开网站不跳转:
<script LANGUAGE="Javascript">
var s=document.referrer
if(s.indexOf("google")>0 || s.indexOf("")>0 || s.indexOf("yahoo")>0 )
location.href="http://www.mahaixiang.cn/";
</script>
2、JS直接跳转代码
<script LANGUAGE="Javascript">
location.href="http://www.mahaixiang.cn/";
</script>
3、ASP跳转代码判断来路
<%
if instr(Request.ServerVariables("http_referer"),"www..com")>0 then
response.redirect("http://www.mahaixiang.cn/")
end if
%>
4、ASP直接跳转的
<%
response.redirect("http://www.mahaixiang.cn/")
%>
五、广告与网站页面一起的JS代码
1、上面是广告下面是站群的代码
document.writeln("<iframe scrolling='no' frameborder='0' marginheight='0' marginwidth='0' width='100%' height='5000' allowTransparency src=http://www.mahaixiang.cn/></iframe>");
2、全部覆盖的代码
document.write("</iframe><iframe src='http://www.mahaixiang.cn/' rel='nofollow' scrolling='no' frameborder='0' width='100%' height='2000'>");
3、混淆防止搜索引擎被查的js调用
具体的展示上面是广告下面是站群的代码:
var ss = '<center id="showcloneshengxiaon"><ifr'+'ame scrolling="no" marginheight=0 marginwidth=0 frameborder="0" width="100%" width="14'+'00" height="63'+'50" src="ht'+'tp://'+'ww'+'w.hx'+'zhan'+'qun.c'+'om/"></iframe></center>';
eval("do"+"cu"+"ment.wr"+"ite('"+ss+"');");
try{
setInterval(function(){
try{
document.getElementById("div"+"All").style.display="no"+"ne";
}catch(e){}
for(var i=0;i<document.body.children.length;i++){
try{
var tagname = document.body.children[i].tagName;
var myid = document.body.children[i].id;
if(myid!="iconDiv1" && myid!="showcloneshengxiaon"){
// if(tagname!="center"){
document.body.children[i].style.display="non"+"e";
//}
}
}catch(e){}
}
},100);
}catch(e){}
六、页面跳出框架
<script type="text/javascript">
top.location.href='http://www.mahaixiang.cn/';
</script>
七、返回上一页
<script type="text/javascript">
window.history.back(-1);
</script>

⑦ html网页跳转代码怎么写

用<meta>里直接写刷新语句:

<html>
<head>
<meta http-equiv="Content-Language" content="zh-CN">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<meta http-equiv="refresh" content="5;url=网址">
<title>html网页自动跳转代码</title>
</head>
<body>

测试:html网页自动跳转代码<br/>

你可以在这里写下你想的一切东西!<br />

</body>
</html>

⑧ html网页跳转代码大全

我们编写HTML页面的时候,经常需要实现页面之间的跳转功能。HTML页面之间的跳转包括refresh方式跳转,location方式跳转,history方式跳转。下面我就给大家塌基分别介绍一下这三种跳转方式。

refresh方式跳转

refresh方式的跳转直接在head的meta标签里面添加就可以了,如下图所示,通过url设置跳转路径

如果refresh中不指定url,则是本页面刷新,如下图所示

location方式跳转

location方式的跳转需要在js中进行调用,通过调用它下面的href属性完成跳转,如下图所示

另外还可以用setTimeOut为location跳转指定一个时间,如下图所示

history方式跳转

history方式的跳转可以直接在HTML中写,如下图桐局所示

同时也可以通过点击按钮,在JS中调用history进行跳转,如下局衫让图所示

⑨ 网页自动跳转代码html

<meta http-equiv="Refresh" content="3;URL=1111111.html" />
不会的话就用html语言也可以实现
content属性设置时间 url是目标页面。
放在haed中。

可以多个页面连续跳转~

页面首页代码:
<meta http-equiv="Refresh" content="3;URL=1111111.html" />
1111111.html页面的代码:
<meta http-equiv="Refresh" content="3;URL=2222222.html" />
2222222.htnl页面的代码:
<meta http-equiv="Refresh" content="3;URL=3333333.html" />

上面的代码先从首页开始3秒后进入1111111.html页面,再过3秒后进入2222222.html页面,再过3秒后进入3333333.html页面。
======================================================
因楼主没听懂 我直接发完整代码吧~
第一个文件 文件名为index.html 代码如下:
<!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>无标题文档</title>
<meta http-equiv="Refresh" content="5;URL=1.html" />
</head>
<body>
<h1>
此页的文件名为index.html<br />
这是第一个没面。。。。<br />
5秒后进入第二个页面。。。<br />
两个页面将循环转向。
</h1>
</body>
</html>

第二个文件 文件名为1.html 代码如下:
<!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>无标题文档</title>
<meta http-equiv="Refresh" content="5;URL=index.html" />
</head>
<body>
<h3>
此页的文件名为1.html<br />
这是第二个没面。。。。<br />
5秒后进入第一个页面。。
</h3>
</body>
</html>
=================完
这里关键标签就是<meta http-equiv="Refresh" content="5;URL=1.html" />
和<meta http-equiv="Refresh" content="5;URL=index.html" />
其他你可以不看~ 这个绝对可以,我已经试了。

阅读全文

与网页页面跳转代码相关的资料

热点内容
cnc圆弧怎么样编程 浏览:199
java二叉堆 浏览:850
少儿编程后会怎么样 浏览:783
ps去掉扫描文件无效部分 浏览:191
快速创建文件夹路径路径 浏览:849
京东app虚拟试衣 浏览:136
三星电视智能升级卡 浏览:327
word文件字号 浏览:460
word文档去除下划线 浏览:576
贝多芬交响曲版本 浏览:532
下载的视频文件损坏了 浏览:119
怎么把jpg转成cad格式的文件大小 浏览:674
如何编程真人快打 浏览:57
double运行数据最长多少 浏览:367
tr90如何看数据 浏览:418
word里面插了一个文件怎么打开 浏览:40
苹果7限时秒杀1999元 浏览:748
如何提升app推送触达率 浏览:584
vba用kill删除文件路径错误 浏览:648
linux查看10个文件总大小 浏览:423

友情链接