In prototype.
1 Event.observeOnce = function(element, event, observer){ 2 var handler = function(){ 3 Event.stopObserv ing(element, event, handler); 4 return observer.apply(null, $A(arguments)); 5 }; 6 Event.observe(element, event, handler); 7 };
The usage is same to Event.obse
1 Event.observeOnce(document, 'dom:loaded ', function(){ 2 /* some code goes here */ 3 });
It may be useful if you copy this into public/jav
posted by
takiuchi
on Thu 28 Feb 2008
at 17:23