zoukankan      html  css  js  c++  java
  • jascript基础教程学习总结(2)

    摘自:javascript基础教程

    用链接对用户进行重定向:

    js001.html

    这个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>Welcome to our site</title>
    <script src="script01.js"></script>
    </head>

    <body>
    <h2 class="centered" id="redirect">
    welcome to our site ... c"smon in !
    </h2>
    </body>
    </html>

    script01.js

    // JavaScript Document
    window.onload = initAll;
    function initAll() {
    document.getElementById("redirect").onclick = initRedirect;
    }
    function initRedirect() {
    window.location = "jswelcome.html";
    return false;
    }

    jswelcome.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>Our Site</title>
    </head>

    <body>
    <h1>Weclome to our web site,which features lots of cutting-edge JavaScript</h1>
    </body>
    </html>

  • 相关阅读:
    泛型
    内部类 及 匿名内部类
    BigDecimal
    JodaTime简介
    Java中IO流
    Spring的ApplicationEvent的使用
    swagger文档使用(springboot项目)
    http连接过程遇到的各种性能瓶颈
    http网络连接过程
    python中的TypeError: 'NavigableString' object is not callable错误
  • 原文地址:https://www.cnblogs.com/peterli2013/p/3180335.html
Copyright © 2011-2022 走看看