Jesus
Jesus

Reputation: 8586

How to open a url with parameters in external browser with WinJS

I have a metro app developed with WinJS in VS2012 and I want to open this address

window.location = "http://XXX.XXX.XX.XXX:XXXX/test/AU/jsp/AU000007.jsp";

this works ok, opens the webpage on new browser from my metro app

But I want to add several parameters encrypted by using jcrypto so I do this:

//message encryption
message = jcrypto(message);
message = "http://XXX.XXX.XX.XXX:XXXX/test/AU/jsp/AU000007.jsp?data=" + message;

window.location = message;

but it just opens the link on my metro app, how to fix that???


UPDATE: thanks to WiredPrairie's suggestion I found this answer:

    var uri = new Windows.Foundation.Uri("http://XXX.XXX.XX.XXX:XXXX/test/AU/jsp/AU000007.jsp?data=" + jcrypto(message));

    //opens the url on external browser
    Windows.System.Launcher.launchUriAsync(uri).done(
        function (success) {
            if (success) { console.log("page opened correctly"); }
            else { console.log("an error has occured"); }
            });

Upvotes: 2

Views: 1681

Answers (1)

Jesús Ayala
Jesús Ayala

Reputation: 2791

try with this other:

//message encryption and URL addition
message = "http://XXX.XXX.XX.XXX:XXXX/test/AU/jsp/AU000007.jsp?data=" + jcrypto(message);

window.open(message, "_blank", "fullscreen=yes,height=600,width=800,scrollbars=yes,resizable=no");

Upvotes: 1

Related Questions