Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Open URL in new window using JavaScript

Avatar

Level 3
Hi Guys,



Hopefully someone can help me with this.

By clicking a button I would like IE or whatever the default browser is to be launched with a specific URL.



I have tried using: xfa.host.gotoURL("http://www.google.com");

but obviously this opens within the window I'm working in. Close but not close enough.



Thanks in advance!



James
7 Replies

Avatar

Former Community Member
I believe you can add another boolean parameter that tells whether to start a new browser or not......or you can use this command:



app.launchURL("address", true);

Avatar

Level 3
Paul,



That worked like a dream, thanks.



James

Avatar

Level 3
Paul,



When I do a Preview PDF when designing the form and click the button then a new window with my URL opens but when I preview the Form Guide and press the button it does nothing. I've double checked that the language I'm using in Javascript.



Any help is much appreciated



James

Avatar

Former Community Member
That command will not work form a guide. It is not supported....only in a PDF.

Avatar

Level 3
Ok thanks Paul.



Do you know of any way to launch a new window from the Form Guide??



Thanks,

James

Avatar

Former Community Member
Not without modifying the guide style ...certainly Flex can do it but that fuctionality has not been exposed in our guide styles.