sweiss
2008-Mar-03 02:53 UTC
Trying to use RJS, raw Try(my javascript) catch is displayed on page
def index redirect_to(:action => ''test'') end def test render :update do |page| page << '' <SCRIPT type="text/javascript">'' page.call ''myfunction'', ''pics\test1.jpeg'' page << '' </script>'' end end mozilla just displayes the following, my function is defined in the layout and my goal is just to call this javascript function when this page is loaded, don''t know how why this won''t work, this is just basic stuff. try { <SCRIPT type="text/javascript"> myfunction("pics\\test1.jpeg"); </script> } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert('' <SCRIPT type=\"text/javascript\">\nmyfunction(\"pics\\\\test1.jpeg\");\n </ script>''); throw e } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ilan Berci
2008-Mar-03 03:16 UTC
Re: Trying to use RJS, raw Try(my javascript) catch is displ
sweiss wrote:> def indexDid you remember to use the javascript_include tags, and do you have javascript enabled for that particular browser.. ilan -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
yep javascript is enabled, and the head of my rhtml template looks like such <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1- strict.dtd"> <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Your title</title> <script type="text/javascript" src="mootools.js"></script> <script type="text/javascript" src="croppr.js"></script> <%= javascript_include_tag :defaults %> <%= active_scaffold_includes %> <link rel="stylesheet" type="text/css" href="main.css"/> <script type="text/javascript"> function myfunction(src) { On Mar 2, 9:16 pm, Ilan Berci <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> sweiss wrote: > > def index > > Did you remember to use the javascript_include tags, and do you have > javascript enabled for that particular browser.. > > ilan > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
how is the remote method ''test'' getting called from the view. Do not include an :update parameter, otherwise the view is expecting a simple render such as render :text=>''Replaced with this'' and wont understand the render :update response block. Tonypm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Erhard Karger
2008-Sep-23 07:25 UTC
Re: Trying to use RJS, raw Try(my javascript) catch is displ
Hi, have the same problem have You solved it ? Can You post the solution Thanks Erhard tonypm wrote:> how is the remote method ''test'' getting called from the view. > > Do not include an :update parameter, otherwise the view is expecting a > simple render such as > render :text=>''Replaced with this'' and wont understand the > render :update response block. > > Tonypm-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---