Html页面跳转

喜欢ヅ旅行 2022-07-21 00:11 395阅读 0赞

1.html页面简单调转的几种方式

  1. <!DOCTYPE html>
  2. <html>
  3. <head lang="en">
  4. <meta charset="UTF-8">
  5. <title>html页面调转方式</title>
  6. </head>
  7. <script type="text/javascript">
  8. //通过location
  9. function fun() {
  10. window.location.href = "a.html";
  11. // window.location = "a.html";//也可以调转
  12. }
  13. function fun2() {
  14. window.location.reload();
  15. }
  16. function fun3(){
  17. window.open("a.html");
  18. }
  19. </script>
  20. <body>
  21. <fieldset>
  22. <legend>html页面调转方式</legend>
  23. <input type="button" onclick="fun()" value="跳转到a.html">
  24. <!--通过超链接方式-->
  25. <a href="a.html">跳转到a.html</a>
  26. <!--刷新-->
  27. <input type="button" onclick="fun2()" value="重新加载b.html"><br><br>
  28. <!--新建窗口指向a.html,不能返回-->
  29. <input type="button" onclick="fun3()" value="创建a.html窗口" ><br><br><br>
  30. <!--form表单方式-->
  31. <form action="a.html" method="post">
  32. <input type="submit" value="到a.html"/>
  33. </form>
  34. </fieldset>
  35. </body>
  36. </html>

2.界面效果如下

a.文档结构图

这里写图片描述

b.b.html

这里写图片描述

c.a.html

这里写图片描述

发表评论

表情:
评论列表 (有 0 条评论,395人围观)

还没有评论,来说两句吧...

相关阅读