Chinaunix首页 | 论坛 | 博客
  • 博客访问: 240729
  • 博文数量: 108
  • 博客积分: 3045
  • 博客等级: 中校
  • 技术积分: 1162
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-19 18:26
文章分类

全部博文(108)

分类: JavaScript

2013-11-26 13:45:02


点击(此处)折叠或打开

  1. <script type="text/javascript" charset="utf-8">
  2.     /*
  3.      javascript php
  4.      对象        类
  5.      对象实例    对象

  6.      字符串对象
  7.      数学对象
  8.      数组
  9.      时间对象

  10.      对象中存在的内容?
  11.      一.属性(变量)
  12.      二.方法(函数)

  13.      都是和这个对象相关的
  14.     一.对象的声明
  15.     二.使用对象
  16.     三.使用系统对象
  17.         步骤:
  18.             1.找到对象
  19.             2.实例化对象
  20.             3.操作对象
  21.             对象实例.属性(取值,赋值)
  22.             对象实例["属性名"]
  23.             对象实例.方法()

  24.             自定对象
  25.             var pro="";
  26.             for (pro in document){
  27.             document.write("document."+pro+"="+document[pro]+"
    ");
  28.             }

  29.             with(对象){
  30.             所有方法如果不加对象都是,括号对象的方法.
  31.             }

  32.             document.write("");
  33.             document.wrtie("
  34. ");
  35.             document.wrtie("
  36. ")
  37.             document.write("
  38. ");

  39.             with(document){
  40.                 write('');
  41.                 ......    
  42.                 write('
  43. ');
  44.                 }

  45.                 for (变量 in 对象){
  46.                     
  47.                 }

  48.                 with(对象){
  49.                 }
  50.  */
  51.     
  52.     
  53.     /*    function Play(){

  54.     var p=new Object();
  55.     //property
  56.     p.width=300;
  57.     p.height=200;
  58.     p.num=4;
  59.     p.autotime=3;

  60.     //fun
  61.     p.autoplay=function(){
  62.         alert("play....");
  63.         alert(this.num);
  64.     }
  65.     p.test=function(){
  66.     
  67.     }

  68.     return p;
  69.     } */

  70. //function Play(width,height,num){
  71. //    this.width=width;
  72. //    this.height=height;
  73. //    this.num=num;
  74. //
  75. //    this.autoplay=function(){
  76. //        alert("#########");
  77. //    }
  78. //    this.test=function(){
  79. //    }
  80. //}

  81. //var p=new Play(3000,200,8);
  82. ////var p=Play();
  83. //
  84. //var pro="";
  85. //for(pro in p){
  86. //    document.write("p."+pro+"="+p[pro]+"
    ");

  87. //}
  88. //alert(p.width);
  89. //p.autoplay();

  90. var pro="";
  91. for (pro in document){
  92.     document.write("document."+pro+"="+document[pro]+"
    "
    );
  93. }
  94. </script>

阅读(385) | 评论(0) | 转发(0) |
0

上一篇:js_date

下一篇:js_array

给主人留下些什么吧!~~