I have a .js file with the following function
function set_priceKind_global(priceKind)
{
switch(priceKind)
{
case "paid":
case "free":
break;
default:
var throw_msg = "Internal confusion in set_priceKind_global"
alert(throw_msg)
throw throw_msg
}
It is triggered by
%input{'type' => 'button', 'value' => 'Free', :onclick => 'set_priceKind_global("free")'}
Because of conflicting libraries, I'd like to wrap set_priceKind_global thusly
(function($) {
// Lots of functions
function set_priceKind_global(priceKind)
{
switch(priceKind)
{
case "paid":
case "free":
break;
default:
var throw_msg = "Internal confusion in set_priceKind_global"
alert(throw_msg)
throw throw_msg
}
})(jQuery);
When I wrap it, Firebug reports that set_priceKind_global is undefined.
How do I expose set_priceKind_global as a function that the onclick can trigger? Or, alternatively, modify the onclick so that the function can be called?
Is there a javascript/jQuery forum that you can recommend?
Ralph Shnelvar
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment