zoukankan      html  css  js  c++  java
  • javascript数据类型和函数的简单的使用

    js变量和数据类型

    <!doctype html>
    <html>
     <head>
      <title>Document</title>
     </head>
     <body>
      <script>
      var a=10;//定义变量
      var b=" abc ";//定义字符串
      var c=[" hello ","world "];//定义数组
      var d=true;//定义bool
      document.write(a);
      document.write(b);
      document.write(c);
      document.write(d);
      </script>
     </body>
    </html>

    js函数

    <html>
    <head>
    <title>a</title>
    </head>
    <body>
    <script>
    function demo(){
    var a=10;
    alert("登陆失败");
    }
    //demo();  //script中调用函数
    </script>
    <button onclick="demo();">按钮</button>  //通过button调用函数
    </body>
    </html>

    require.js作用:
      (1)实现js文件的异步加载,避免网页失去响应;
      (2)管理模块之间的依赖性,便于代码的编写和维护。
    用法:http://www.ruanyifeng.com/blog/2012/11/require_js.html


  • 相关阅读:
    pycharm的常规使用
    python-引用/模块
    6-4 函数
    5-21文件的操作
    5-21python数据类型
    python-基础
    5-7接口测试工具之jmeter的使用
    接口测试基础
    把命令结果作为变量赋值
    shell变量子串
  • 原文地址:https://www.cnblogs.com/wangxueliang/p/9346518.html
Copyright © 2011-2022 走看看