All, I''m writing a Rails based app. I''m still on Rails version 1.2.2. I need to start an external app from within the browser, only IE and pass an argument to it. The only way I found was using ActiveX. <script language="javascript" type="text/javascript"> function OpenFile(cmd){ var x = new ActiveXObject("WScript.Shell"); x.run(cmd) } </script> and then call it with onClick="OpenFile(''C:\\projects\\some.exe c:\\projects\ \someinputfile.rpt'') This works if I just use a regular HTML file and call it. In Rails for testing I call it like this: <div> some content </div> <script type="text/javascript"> function OpenFile(){ alert("Starting ActiveX"); var x = new ActiveXObject("WScript.Shell"); x.run("C:\\projects\\some.exe c:\\projects\ \someinputfile.rpt'') } OpenFile(); </script> The function gets called but the ActiveXObject never gets created. Any ideas? Regards Peter --~--~---------~--~----~------------~-------~--~----~ 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 4 Feb 2008, at 14:03, wlodarczak wrote:> > The function gets called but the ActiveXObject never gets created. > Any ideas?By regular html file i assume you mean that you just pasted that into a .html and opened it. That almost certainly means that different security settings are used from the rails app (since that is bytes arriving over the network (albeit from the same machine)) Fred> > Regards > Peter > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thank you for the quick reply, lowering the security did the trick. Peter On Feb 4, 3:16 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 4 Feb 2008, at 14:03, wlodarczak wrote: > > > The function gets called but the ActiveXObject never gets created. > > Any ideas? > > By regular html file i assume you mean that you just pasted that into > a .html and opened it. That almost certainly means that different > security settings are used from the rails app (since that is bytes > arriving over the network (albeit from the same machine)) > > Fred > > > > > Regards > > Peter--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---