1. <html>
    2. <head>
    3. <meta charset="utf-8">
    4. <script language="javascript">
    5. // String str = "hello world" ;
    6. /*
    7. var str = "hello world";
    8. alert(typeof str);
    9. str = 9999 ;
    10. alert(typeof str);
    11. */
    12. /*
    13. var person = new Object();
    14. person.pid = "p001";
    15. person.pname="鸠摩智";
    16. alert(person.pid+"_"+person.pname);
    17. */
    18. //java 方法
    19. public String hello(String name){
    20. return "hello to " + name ;
    21. }
    22. //js 方法
    23. function hello(num1 , num2 , name){
    24. if(num1>num2){
    25. return "hello to" + name ;
    26. }else{
    27. alert("HELLO");
    28. }
    29. }
    30. </script>
    31. </head>
    32. <body>
    33. </body>
    34. </html>
    35. <!--
    36. Javascript : 客户端的一个脚本语言
    37. js是一门弱类型的语言 , 变量的数据类型由后面赋的值的类型决定
    38. -->