Problem with onload

Hi all,
Does someone know why the following code doesn´t work if it is embedded
in a partial?in a regular .rhtml file works well.

2009/10/14 Rafael R. [email protected]:

Hi all,
Does someone know why the following code doesn´t work if it is embedded
in a partial?in a regular .rhtml file works well.

Check the generated html in your browser if you have not done that
already (View, Page source or similar). Also try pasting the entire
html into the w3c html validator to check there are no errors.

Colin

Rafael R. wrote:

Hi all,
Does someone know why the following code doesn´t work if it is embedded
in a partial?in a regular .rhtml file works well.

I’m not sure on a quick look. But I do notice a couple of tangential
issues that might or might not be related:

  • If you’re using Rails 2.x, the .rhtml suffix is deprecated. Use
    .html.erb .

  • JavaScript really belongs in separate files, not mixed into HTML.
    This is especially helpful for code like yours that has to be available
    before the page is done loading. At the very least, try moving the

into the element. Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected]