[Rails] Re: Strange behaviour with two *.js which has window.onload directives

2014-06-22 Thread Damián M. González
Yes, I've realized that onload is an attribute of window, so if I do window.onload = something twice I'm overwriting the value of the attribute. Thanks. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk

Re: [Rails] Re: Strange behaviour with two *.js which has window.onload directives

2014-06-22 Thread Hassan Schroeder
On Sat, Jun 21, 2014 at 5:45 PM, Damián M. González wrote: > Okay, I've found why!!! But this arise another question. > I've tested this: erased one of the files, in the other I've added a > window.onload below the first window.onload and a strange thing > happened: the last window.onload gets ex

[Rails] Re: Strange behaviour with two *.js which has window.onload directives

2014-06-21 Thread Damián M. González
Been doing some little more stuff. If I put the code of both *.js on the corresponding views(inside ) works like a charm. So why? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe

[Rails] Re: Strange behaviour with two *.js which has window.onload directives

2014-06-21 Thread Damián M. González
Okay, I've found why!!! But this arise another question. I've tested this: erased one of the files, in the other I've added a window.onload below the first window.onload and a strange thing happened: the last window.onload gets executed. So this takes me to the conclusion: I can't "monkeypatch"