Adding Javascript Function to Rails 3
Hi I was wondering how to format a javascript function as simple as:
function calculate()
{
alert('calculate Cost');
}
so that it can be placed into the assets/javascripts/application.js and be
called from the view.
On my view I am calling the function by:
<input type="button" onclick="calculate();" value="calculate">
For some reason the function is not being called but it works if I put the
alert message via inline: onclick="alert('calculate Cost');"
No comments:
Post a Comment