三种不同的跳转页面效果 (512人路过)

02:57 , 引用(0) Via 本站原创

当你的页面更改或者不再使用时你可以用以下的代码放在老页面中,这样浏览者访问老页面后将会跳转到新的页面

第一种

跳转到对应页面而不给浏览者任何提醒.

引用

<html>
<script>
location = "http://i-code.co.uk/index.php";
</script>
</html>

第二种

当你希望告诉浏览者他访问的页面地址已经更改并将会跳转到新的页面时可以使用这种,浏览者按下OK后才会跳转到新的页面

引用

<html>
<script>
alert("This page has been moved to a new location... click OK to be redirected?");
location = "http://i-code.co.uk/index.php";
</script>
</html>


第三种

这种将会给浏览者选择的权利是跳转到新页面还是返回前面的页面

引用

<html>
<script>
if(confirm("This page has been moved to a new location... would you like to be redirected?"))
{
location = "http://i-code.co.uk/index.php";
}
else
{
history.back();
}
</script>
</html>

作者:77run@齐齐奔跑 -- 骑士威科技
地址:http://blog.77run.com/san-zhong-bu-tong-de-tiao-zhuan-ye-mian-xiao-guo/
版权所有©转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: 77run 编辑于2011/09/15 23:51
| |
0 Responses to "A Sample Post with Links"
发表评论
  • 昵称 [注册]
  • 密码 游客无需密码
  • 网址
  • 电邮
打开HTML 打开UBB 打开表情 隐藏 记住我