zoukankan      html  css  js  c++  java
  • 吴裕雄--天生自然PHP-MySQL-JavaScript学习笔记:探究JavaScript

    <html>
      <head><title>Hello World</title></head>
      <body>
        <script type="text/javascript">
          document.write("Hello World)
        </script>
      </body>
    </html>
    Examples 14-4 to 14-7 are non-runnable illustrations of error messages
    <script>
    function product(a, b)
    {
        return a*b
    }
    </script>
    <script>
      n = '838102050'        // Set 'n' to a string
      document.write('n = ' + n + ', and is a ' + typeof n + '<br>')
    
      n = 12345 * 67890;     // Set 'n' to a number
      document.write('n = ' + n + ', and is a ' + typeof n + '<br>')
    
      n += ' plus some text' // Change 'n' from a number to a string
      document.write('n = ' + n + ', and is a ' + typeof n + '<br>')
    </script>
    <script>
      function product(a, b)
      {
        return a*b
      }
    </script>
    <script>
      function test()
      {
            a = 123               // Global scope
        var b = 456               // Local scope
        if (a == 123) var c = 789 // Local scope
      }
    </script>
    <script>
      test()
    
      if (typeof a != 'undefined') document.write('a = "' + a + '"<br />')
      if (typeof b != 'undefined') document.write('b = "' + b + '"<br />')
      if (typeof c != 'undefined') document.write('c = "' + c + '"<br />')
    
      function test()
      {
         a     = 123
        var b = 456
    
        if (a == 123) var c = 789
      }
    </script>
    <html>
      <head>
        <title>Link Test</title>
      </head>
      <body>
        <a id="mylink" href="http://mysite.com">Click me</a><br />
        <script>
          url = document.links.mylink.href
          document.write('The URL is ' + url)
        </script>
      </body>
    </html>
    <script>
      function $(id)
      {
        return document.getElementById(id)
      }
    </script>
    <html>
      <head><title>Hello World</title></head>
      <body>
        <script type="text/javascript">
          document.write("Hello World")
        </script>
        <noscript>
          Your browser doesn't support or has disabled JavaScript
        </noscript>
      </body>
    </html>
    <html>
      <head><title>Hello World</title></head>
      <body>
        <script type="text/javascript"><!--
          document.write("Hello World")
        // -->
        </script>
      </body>
    </html>
  • 相关阅读:
    自动化测试-18.selenium之bugFree代码注释
    自动化测试-16.selenium数据的分离之Excel的使用
    自动化测试-15.selenium单选框与复选框状态判断
    自动化测试-14.selenium加载FireFox配置
    自动化测试-13.selenium执行JS处理滚动条
    Lucas-Kanade算法总结
    迟来的2013年总结及算法工程师/研究员找工作总结
    Android从文件读取图像显示的效率问题
    Viola Jones Face Detector
    谈谈Android中的SurfaceTexture
  • 原文地址:https://www.cnblogs.com/tszr/p/12382803.html
Copyright © 2011-2022 走看看