How to use flash in javascript?


#1

The following code can not run:

This is a test

How to combine the <%= %> pairs with the javascript code?


#2

pinnacle wrote:

The following code can not run:

This is a test
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]?