attachEvent
为注册事件,onreadystatechange
表示状态完成,动作发生

解决方案 »

  1.   

    img.attachEvent("onreadystatechange",orsc);  //将事件和方法绑定
    onreadystatechange是事件,orsc是方法,意思是说当触发onreadystatechange事件的时候调用orsc方法。(问题二同)
    onreadystatechange是当属性改变时触发的事件。
    onerror是产生错误的时候,触发的事件。
    觉得你最好找个资料好好看看。
      

  2.   

    attachEvent
    将事件和方法绑定onreadystatechange
    属性值发生更改,则调用该方法。
      

  3.   

    IE下的吧,FF下不起作用
    FF下用addEventListener和removeEventListener
    而且事件名称不要加on附一段IE下绑定事件和移除事件的资料,建议下载“网页制作完全手册”里面这些函数的资料都有,不过只是针对IE的……
    attachEvent Method  Internet Development Index --------------------------------------------------------------------------------Binds the specified function to an event, so that the function gets called whenever the event fires on the object.SyntaxbSuccess = object.attachEvent(sEvent, fpNotify)
    ParameterssEvent Required. String that specifies any of the standard DHTML Events. 
    fpNotify Required. Pointer that specifies the function to call when sEvent fires. Return ValueBoolean. Returns one of the following possible values:true The function was bound successfully to the event. 
    false The function was not bound to the event. detachEvent Method  Internet Development Index --------------------------------------------------------------------------------Unbinds the specified function from the event, so that the function stops receiving notifications when the event fires.Syntaxobject.detachEvent(sEvent, fpNotify)
    ParameterssEvent Required. String that specifies any of the standard DHTML Events. 
    fpNotify Required. Pointer that specifies the function previously set using the attachEvent method. Return ValueNo return value.