Hi, I ve performed some search but i don t really find what i want to do.. So it s simple, i need to get back in a controller or a view a Javascript variable (which i use to detect the version of a flash player).. How can i dot that ? thank you for helping Guillaume. -- 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 -~----------~----~----~----~------~----~------~--~---
Hi, Do this by making this call in the <head> section of your .rhtml page. <%= javascript_include_tag "Name Of Javascript" %> I thik this will resolve your problem. Julio On 5/7/07, Guillaume <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi, > > I ve performed some search but i don t really find what i want to do.. > So it s simple, i need to get back in a controller or a view a > Javascript variable (which i use to detect the version of a flash > player).. > > How can i dot that ? > > thank you for helping > > Guillaume. > > -- > Posted via http://www.ruby-forum.com/. > > > >-- abracos, Julio Cesar --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks for your help, but i already included that... my problem is to return the Javascript variable in a ruby variable... Cause Javascript is executed on Client side, so i don t see how to get back the content of that variable later in the ruby code I hope to be clear.. thanks Julio Cesar wrote:> Hi, > > Do this by making this call in the <head> section of your .rhtml page. > <%= javascript_include_tag "Name Of Javascript" %> > > I thik this will resolve your problem. > > Julio > > On 5/7/07, Guillaume <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> thank you for helping >> >> Guillaume. >> >> -- >> Posted via http://www.ruby-forum.com/. >> >> > >> > > > -- > abracos, > > Julio Cesar-- 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 -~----------~----~----~----~------~----~------~--~---
On May 7, 2007, at 10:36 PM, Guillaume wrote:> Thanks for your help, > but i already included that... my problem is to return the Javascript > variable in a ruby variable... > > Cause Javascript is executed on Client side, so i don t see how to get > back the content of that variable later in the ruby codeYou have to send it back somehow. A hidden field in a form, a parameter in the URL, Ajax, .... You''ll typically write JavaScript code to hook into the new request to add the value of the variable when the request starts. For instance, if there''s a form some code in onsubmit sets the hidden field to the value of the variable at that moment. You see the idea. -- fxn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Maybe you should include some more context regarding your problem. There are many ways to send client information to the server....you could send this along as part of a form POST, or in the query part of a URL, or using XMLHttpRequest, or.... Guillaume wrote:> Thanks for your help, > but i already included that... my problem is to return the Javascript > variable in a ruby variable... > > Cause Javascript is executed on Client side, so i don t see how to get > back the content of that variable later in the ruby code > > I hope to be clear.. > > thanks >-- 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 -~----------~----~----~----~------~----~------~--~---
So there it is... I ve got some javascript in a view (a part of the view code)... this javascript has a variable TOTO... At the end of the javascript execution in the view, this variable TOTO contain information that i need later... So to use this information later, i need to put the content of the Javascript variable TOTO in a new ruby variable... how do you do that ? thanks again Guest wrote:> Maybe you should include some more context regarding your problem. > There are many ways to send client information to the server....you > could send this along as part of a form POST, or in the query part of a > URL, or using XMLHttpRequest, or.... > > Guillaume wrote: >> Thanks for your help, >> but i already included that... my problem is to return the Javascript >> variable in a ruby variable... >> >> Cause Javascript is executed on Client side, so i don t see how to get >> back the content of that variable later in the ruby code >> >> I hope to be clear.. >> >> thanks >>-- 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 -~----------~----~----~----~------~----~------~--~---
any idea ? thank you.. Guillaume wrote:> So there it is... > > I ve got some javascript in a view (a part of the view code)... this > javascript has a variable TOTO... > At the end of the javascript execution in the view, this variable TOTO > contain information that i need later... > > So to use this information later, i need to put the content of the > Javascript variable TOTO in a new ruby variable... > > how do you do that ? > > thanks again > >-- 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 -~----------~----~----~----~------~----~------~--~---
I think what other people have already said. Put your variable inside a hidden text field or someplace else in the dom and then read it out of it with an AJAX call. There''s multiple possibilities for getting the value with something like that. On 5/8/07, Guillaume <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > any idea ? > > thank you.. > > > Guillaume wrote: > > So there it is... > > > > I ve got some javascript in a view (a part of the view code)... this > > javascript has a variable TOTO... > > At the end of the javascript execution in the view, this variable TOTO > > contain information that i need later... > > > > So to use this information later, i need to put the content of the > > Javascript variable TOTO in a new ruby variable... > > > > how do you do that ? > > > > thanks again > > > > > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Terry (TAD) Donaghe http://tadspot.tumblr.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 -~----------~----~----~----~------~----~------~--~---
You said multiple possibilty... could you give me a bit of more details, so i will google it... i me quiet a newb on RoR, so... Thank you.. Terry Donaghe wrote:> I think what other people have already said. Put your variable inside a > hidden text field or someplace else in the dom and then read it out of > it > with an AJAX call. There''s multiple possibilities for getting the value > with something like that. > > On 5/8/07, Guillaume <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> > I ve got some javascript in a view (a part of the view code)... this >> > >> > >> >> -- >> Posted via http://www.ruby-forum.com/. >> >> > >> > > > -- > Terry (TAD) Donaghe > http://tadspot.tumblr.com-- 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 -~----------~----~----~----~------~----~------~--~---