I have a button with an onclick callback that creates a closure and
uses Element.observe to clear the old callback and set the closure as
the new one. Here's the pseudo code:

<button onclick='original_handler.bind(this)(event)'>button</button>

function original_handler(event) {
  //do some stuff on the first click

  //now clear the original handler and set the new one
  this.writeAttribute({onclick:null});
  //create the newCallback
  function newCallback(event) {
    //do some new stuff when we click the second time
  }
  this.observe('click',newCallback);
}

Everything works fine in firefox and chrome but in IE8 when the new
callback
is set IE8 actually calls the function and messes everything up. So
instead of
click->call original_handler->set newCallback what I get is
click->call original_handler->set newCallback->call newCallback which
is not
what I want at all. Any advice on how to fix the situation.

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to