I''m using remote request to update a div with a table. At the end of
the table I have some javascript where I define a function
--------------------------------------
# start table.rhtml
<table>
<tr onclick="update_values()">
etc...
</tr></table>
<script>
function update_values()
{
do_something
}
</script>
# end table.rhtml
----------------------------
But when I try to call that function i got the error "update_values is
not defined".
I have evalscript:true
If i put for example alert(''hello'') after the function, i get
the
alert when the script is loaded, but the function (Conclusion: the
script is executed but the function is not defined)
I don''t understand. For example, the function es executed if I change
the script to
--------
<script>
function update_values()
{
do_something
}
update_values()
</script>
-------
But It does not work if I change it to
--------
<script>
function update_values()
{
do_something
}
</script>
<script>
update_values()
</script>
-------
??
Thanks
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---