I''m not sure that the javascript action attributes can be set in that
way. You''ll be setting the attribute to the string which is the second
parameter to your function, but the system doesn''t know that said
string
is a function to be called. The better way to do this is to use the
Event.observe() function [1] like this:
Event.observe("buttonID", "click", function() {
myFunction(''myVariable'') });
[1] http://prototypejs.org/api/event/observe
- Dash -
youngApprentice wrote:> Anyone know why IE would be ignoring the onclick of a button? I''m
> setting the button''s onclick event using Prototype like this $
>
(''buttonID'').setAttribute("onclick","myFunction(''myVariable'');"
>
> Firefox and IE both show the onclick setting as
> myFunction(''myVariable'') in the generated source, but
only Firefox is
> firing the onclick.
>
> TIA,
> youngApprentice
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---