Rafael Roque 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.
> 
> <script>
>   document.observe('dom:loaded', function() {
> alert('testing');
> });
>   </script>

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 
<script> into the <head> element.

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

-- 
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 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to