zoukankan      html  css  js  c++  java
  • 入门-1

    开发环境:webstorm 6.0

    基础铺垫:Web 2.0,XHTML和CSS

    javacript的重要作用:

    1. 基于web的应用程序的标准客户端脚本语言

    2. 服务器端的脚本基础

    程序调试前准备: 修改IE的Internet选项—安全-允许本地运行活动的内容

    高级-浏览-显示脚本错误的提示

    Netscape和Microsoft构建Javacript标准

    ch4_1.html

    <!DOCTYPE html>
    <html>
    <head>
        <title>First Program in Javascript</title>
        <script type = "text/javascript">
            <!--
                    document.writeln("<h1>Welcome to Javascript Programming!</h1>");
            //-->
        </script>
    </head>
    <body>
    
    </body>
    </html>
    
    
    <script type = "text/javascript">
            <!--
                   被封装的代码
                   如果浏览器支持,就执行;否则识别为注释
        
            //-->
        </script>

    Javascirpt中的字符串可以封装在双引号或单引号中

    每条语句添加分号隔开

    对大小写敏感

    ch4_2.xhtml

    <!DOCTYPE html>
    <html>
    <head>
        <title>Pringting a Line with Multiple statements</title>
        <script type="text/javascript">
            <!--
            document.write("<h1 style = "color: magenta">");
            document.write("Welcome to Javascript " + "Programming!</h1>");
            //-->
        </script>
    </head>
    <body></body>
    </html>

    ch4_3.html

    <!DOCTYPE html>
    <html>
    <head>
        <title>Pringting Multiple Lines</title>
        <script type="text/javascript">
            <!--
            document.writeln("<h1>Welcome to <br/> javascript<br/>" +
                    "Programming</h1>");
            //-->
        </script>
    </head>
    <body></body>
    </html>

    ch4_4.html

    <!DOCTYPE html>
    <html>
    <head>
        <title>Pringting Multiple Lines</title>
        <script type="text/javascript">
            <!--
            window.alert("Welcome to
    Javascript
    Programming!");
            //-->
        </script>
    </head>
    <body>
    <p>please refresh or reload this script again!</p>
    </body>
    </html>

    ch4_5.html

    <!DOCTYPE html>
    <html>
    <head>
        <title>Pringting Multiple Lines</title>
        <script type="text/javascript">
            <!--
            var name;
    
            name = window.prompt("Please enter your name");
    
            document.writeln("<h1>Hello, " + name + ", welcome to javascript programming!</h1>");
            //-->
        </script>
    </head>
    <body>
    <p>please refresh or reload this script again!</p>
    </body>
    </html>
  • 相关阅读:
    poj 1837 Balance
    poj 3009 Curling 2.0
    vagrant up 无法加载映像目录
    liunx 查看php 安装的扩展
    树莓派 添加超级管理员身份
    Sublime text追踪函数插件:ctags[转载]
    手动安装m4, autoconf, automake, libtool
    nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"
    如何将编码转为自己想要的编码 -- gbk utf-8
    laravel 增删修改
  • 原文地址:https://www.cnblogs.com/tmmuyb/p/8088088.html
Copyright © 2011-2022 走看看