Event.observe(window, 'load', function () {
alert('1');
});
Event.observe(window, 'load', function () {
alert('2');
});
Firefox, opera alerts 1 then 2, IE alerts 2 THEN 1!! Order is
reversed and developeres are puzzled! Why isn't this issue still
fixed?!
--
You received this message because
I'm using prototype 1.5
I want to click once and update text in two div parts. But I find
out when I click the first time, nothing happened; when I click the
second time, both div changed. why is that?
How can I click only once, change both of these divs.
Thank you in advance
Yuncong
!--
I've been playing with the Event.observe function as i need it to pass
extra arguments to my callback function and keeping 'this' in the
scope of the callback function Object.
I don't know if theres a better way to do this but thought i would
share it here.
observe: function(){
var args
Hi there,
Events can be attached multiple times to the same element.. is there a
way to prevent this?
Something like ...
if(!$(el).hasEventAttached()) Event.observe($(el), 'click',
function());
... would be great
Any way to achieve this?
Roland,
I discovered a funny pheno, which I don't know anyone else has stated
this before.
Say I define a class:
function Cat(){
this.color = yellow;
}
Cat.prototype.showColor = function(){
alert(this.color)
}
Cat.prototype.init(){
Event.observe(button, click, this.showColor);
}