这是我的代码,在此我想在某些条件下调用 java 脚本函数,例如如果 a = 1 比调用 hi() 函数和 a = 2 比调用 hello() 函数
<%= f.collection_select :ser_id, @ser, :id, :name, :prompt => true -%>
Javascript函数是
function hi()
{
alert("hi");
}
function hello()
{
alert("hello");
}
所以现在给我一些想法,我怎样才能根据给定的条件调用这些函数。