ITPub博客

首页 > 应用开发 > IT综合 > 网页跳转代码集合,多大点事~

网页跳转代码集合,多大点事~

原创 IT综合 作者:懒惰的秀才 时间:2015-04-08 15:05:29 0 删除 编辑

  当你在浏览器中访问A页面时,会自动跳转到B页面,这种跳转较为常用,也较为常见,往往用在404页面中会比较多点。网页跳转代码可以有多种方法实现,懒惰的秀才举几种最好最简单的方法。来杯Coffee,一起来看看。

  用Meta标签进行跳转

点击(此处)折叠或打开

  1. <html>
  2. <head>
  3. <meta http-equiv=\"Content-Language\" content=\"zh-CN\">
  4. <meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=gb2312\">
  5. <meta http-equiv=\"refresh\" content=\"0.1;url=http://blog.itpub.net/30197105/\">
  6. <title></title>
  7. </head>
  8. <body>
  9. </body>
  10. </html>
        简单粗暴的location跳转

点击(此处)折叠或打开

  1. <html><head><title>稍候。。。</title></head>
  2. <body>
  3. <script language=\'javascript\'>document.location = \'http://www.ncnews.com.cn/djzx/nxys/2015-03/24/content_776753.htm\'</script>
  4. </body>
  5. </html>
        延迟跳转VS手动跳转

点击(此处)折叠或打开

  1. <html>
  2. <head>
  3. <meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">
  4. <title>正在进入</title>
  5. </head>
  6. <body>
  7. <form name=loading>
  8.  <p align=center> <font color=\"#0066ff\" size=\"2\">正在进入,请稍等</font><font color=\"#0066ff\" size=\"2\" face=\"Arial\">...</font>
  9.   <input type=text name=chart size=46 style=\"font-family:Arial; font-weight:bolder; color:#0066ff; background-color:#fef4d9; padding:0px; border-style:none;\">
  10.   
  11.   <input type=text name=percent size=47 style=\"color:#0066ff; text-align:center; border-width:medium; border-style:none;\">
  12.   <script> 
  13. var bar=0 
  14. var line=\"||\" 
  15. var amount=\"||\" 
  16. count() 
  17. function count(){ 
  18. bar=bar+2 
  19. amount =amount + line 
  20. document.loading.chart.value=amount 
  21. document.loading.percent.value=bar+\"%\" 
  22. if (bar<99) 
  23. {setTimeout(\"count()\",100);} 
  24. else 
  25. {window.location = \"http://blog.itpub.net/30197105/\";} 
  26. }</script>
  27.  </p>
  28. </form>
  29. <p align=\"center\"> 如果您的浏览器不支持跳转,<a style=\"text-decoration: none\" href=\"http://blog.itpub.net/30197105/\"><font color=\"#FF0000\">请点这里</font></a>.</p>
  30. </body>
  31. </html>

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30197105/viewspace-1547599/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2015-04-08

  • 博文量
    1
  • 访问量
    1867