本帖最后由 dh20156 于 2010-01-07 10:08:42 编辑

解决方案 »

  1.   

    演示地址:http://www.jslab.org.cn/?tag=easyChange
      

  2.   

    我愣是没看明白,
        try{this.watch("value",function(id,oldval,newval){foochange(newval);return newval;});}catch(e){}这个this.watch是干嘛的
      

  3.   

    貌似这样调用很危险
    var dx = document.getElementById('x');easychange.call(dx,(function(){return function(newvalue){dx.value="xxxx"+dx.value}})(dx));
      

  4.   

    或者easychange.call(o,(function(){return function(newvalue){o.value="name:"+newvalue}})(o));
      

  5.   


    Mozilla浏览器捕获Object Property Change的方法,此方法可处理FF等浏览器的脚本设置值的捕获。
      

  6.   

    暂时木有,只有一些感觉或想法,觉得编写 js 应该加入更多的设计,
    具体说就是应该使用 OO 中的工厂模式,
    在其中集中能遇见的各种浏览器类型,从而得到相应的 BOM 实例。换言之,以斑竹的代码为例,假设仅考虑 IE 和 FF 两种浏览器的情况下,
    代码至少应该分为两个方法,TraceInputValueChangeForIE 和 TraceInputValueChangeForFF,
    在不同浏览器下会自动调用相应的方法。当增加新浏览器 NewBrowser 时,只需增加 TraceInputValueChangeForNB 等一套 Function 即可!这样即可以方便不同浏览器下独立调试,又方便扩展!由于浏览器是对象,因此分要比合方便得多!以上思路仅供参考!
      

  7.   

    ding  qi      ding qi 
      

  8.   

    有没有人有一些WEBKIT引擎的开发参考资料呢?
      

  9.   

    这个问题我也碰到过,记得也是Safari没有搞定。
    this.textarea_editor.onpropertychange = function() {
    self.digitalCard.setDigital(self.maxLength - this.value.length);
    } if (typeof this.textarea_editor.addEventListener == "function") {
    this.textarea_editor.addEventListener("keypress", this.textarea_editor.onpropertychange, false);
    this.textarea_editor.addEventListener("keyup", this.textarea_editor.onpropertychange, false); 
    this.textarea_editor.addEventListener("input", this.textarea_editor.onpropertychange, false);
    }
      

  10.   

    不太建议监听onmousemove,这个触发会很频繁
      

  11.   

    恩,是的,改成onmouseover吧。