Prototype This page is part of the Prototype JavaScript framework documentation.
Overview | (...)

Event.stopObserving will remove an event handler defined by Event.observe.

Syntax


  Event.stopObserving(element, name, observer, [useCapture]);

In intend to use this, observer must be the name of the callback function or a variable with the function assigned but not an anonymous function.
here an exemple of how this should work


<span id='myelmt'>Click me to stop me to be observed</span>
<script>
function myobserver(){ // var myobserver = function(){...} will work too 
  alert('stop event observing');
  //stop observing event
  Event.stopObserving('myelmt','click',myobserver);
};

// start observing the event
Event.observe('myelmt','click',myobserver);
</script>