var ioko = Class.create();//什么意思?
var cheboxarr= new Array();
ioko.BoundCheckboxMaster = Class.create({//什么写法?什么意思?
    initialize: function(clientId)//什么写法?什么意思?
    { 
this.childArray = new Array();
        this.element = $(clientId);
        this.element.observe("click", this.onClick.bindAsEventListener(this));//observe()什么意思??
        this.element.__boundcheckbox=this;
    },    registerChild : function(child) {
     //this.childArray.push(child);
     cheboxarr.push(child);
    },
    
    onClick : function(event)
    {
        for ( var child in cheboxarr) {
         // TODO: we seem to register everything twice 
         // but the second set are not valid (child.element is null)
         if(typeof(cheboxarr[child].element)=='object')
         cheboxarr[child].element.checked=this.element.checked;
        }
        return false;
    }
});大哥们  指点小弟一下  感激

解决方案 »

  1.   

    你的结帖率让人望而却步!貌似这个从外面引入了 个Class类  类里有个create方法   observe是属性  总之去找那个Class吧
      

  2.   


    <script>
    /**
     * 说明:这是框架prototype.js中的写法,没接触过这个框架,仅供参考
     */
    var ioko = Class.create();//什么意思?(创建一个类基赋值给ioko)
    var cheboxarr= new Array();
    ioko.BoundCheckboxMaster = Class.create({//什么写法?什么意思?(给增加属性ioko、方法)
      initialize: function(clientId)//什么写法?什么意思?(框架中初始化方法)
      {  
    this.childArray = new Array();
      this.element = $(clientId);
      this.element.observe("click", this.onClick.bindAsEventListener(this));//observe()什么意思??(貌似是绑定事件,相当于:ie中的attachEvent,ff中的document.addEventListener)
      this.element.__boundcheckbox=this;
      },  registerChild : function(child) {
      //this.childArray.push(child);
      cheboxarr.push(child);
      },
        
      onClick : function(event)
      {
      for ( var child in cheboxarr) {
      // TODO: we seem to register everything twice  
      // but the second set are not valid (child.element is null)
      if(typeof(cheboxarr[child].element)=='object')
      cheboxarr[child].element.checked=this.element.checked;
      }
      return false;
      }
    });
    </script>
      

  3.   


    prototype的东西
    Class.create();相当于调用Class对象的create方法
    Class.create({这里是添加函数或属性,和apply函数很像。就是往里面写东西
    this.element.observe("click", this.onClick.bindAsEventListener(this));//给当前元素绑定click事件
      

  4.   

    那个框架的源码应该比Jquery易读;Class.create 类似new一个对象,并调用方法initialize初始化属性,相当于调用了构造函数