The following code can not run:
<div id="aaa">This is a test</div>
<script>
function foo(id)
{
Element.hide($(id));
<% for name in [:notice, :warning, :message] %>
<% if flash[:notice] %>
Element.hide($(abc));
<% end %>
<% end %>
}
</script>
How to combine the <%= %> pairs with the javascript code?
--
Posted via http://www.ruby-forum.com/.
pinnacle wrote:> The following code can not run: > > <div id="aaa">This is a test</div> > <script> > function foo(id) > { > Element.hide($(id)); > <% for name in [:notice, :warning, :message] %> > <% if flash[:notice] %>Is that a typo, or do you mean flash[name]? -- Alex