I recently found out that calling Event.Observe(window,'load',init) from
within the onload function (it was burried in a class) doesn't work too
well...
But David is right.
On 6/12/07, David Dashifen Kees <[EMAIL PROTECTED]> wrote:
>
>
> Alternately, to avoid having to add information to the <body> tag, you
> could use the Event.observe() function of prototype to get the same
> functionality:
>
> Event.observe(window, "load", function() {
> /* ... do onload functions here ... */
> });
>
> Or, if you have everything you need to do within a function already --
> we'll call it init() -- you could do this:
>
> Event.observe(window, "load", init);
>
> which avoids the need for the anonymous function. Really, the two
> methods are roughly equivalent if you only have one function to call at
> the start of every page. But, if you ever need to call this function
> and that one a page loads, the Event.observe() function can be used
> twice and both functions will be called, but the onload attribute of the
> body makes this a little more difficult. 'Course, if you're an
> enthusiast for unobtrusive javascript, the Event.observe() function is
> probably already your best friend.
>
> - Dash -
>
> Sebastian Sastre wrote:
> > OK, figured out now. Was happening to me some sort of loading time/
> > loading order problem.
> > For the record I've suggested a recomendation from a seasider of
> > ensuring order and preventing any transident time invocation. Once
> > things are settled enough all seems to behave as expected.
> > I hope this help on future references,
> > cheers,
> >
> > Sebastian
> > PD: the solution was based on using onLoad of the <body> (not any
> > other) section to call a function that basically initializes everything
> >
> >
> > >
> >
> >
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---