juandx

第一个jswelcom.html

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>welcom~~~~~~~~~~~~~~</title>
  <script type="text/javascript" src="script07.js">
  </script>
 </head>
 <body bgcolor="#FFFFFF">
    <h2 align="center">
        <a href="nojsengine.html" id="redirect">welcom,touch me to the next page~//浏览器如果没有启用javascript就走这条连接,如果启用了则走外部脚本
        </a>
        <h3>
            hello
        </h3>
    </h2>
 </body>
</html>

 

第二个是外部脚本script07.js

window.onload = initAll;//界面加载完毕后触发initAll函数

function initAll()
{
    document.getElementById("redirect").onclick = initRedirect;//redirect元素被点击时触发initRedirect函数
}

function initRedirect()
{
    window.location = "script04.html";//设置新页面
    return false;//停止用户对点击的处理
}

 

第三个是要跳转到的script04.html

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 
  <title>our site</title>
 </head>
 <body bgcolor="#FFFFFF">
    <h1>
    Welcom to our web site,which features lots of cutting-edge javascript
    </h1>
  
 </body>
</html>

 

分类:

技术点:

相关文章:

  • 2022-02-09
  • 2021-08-02
  • 2021-12-21
  • 2021-09-29
  • 2021-12-21
  • 2021-06-25
  • 2021-11-05
  • 2021-12-19
猜你喜欢
  • 2021-12-15
  • 2021-08-02
  • 2022-01-26
  • 2022-01-01
  • 2021-11-23
  • 2021-05-26
  • 2021-12-23
相关资源
相似解决方案