2
我有在VS2012 WinJS開發的Metro應用,我想打開這個地址如何打開一個網址,在外部瀏覽器參數與WinJS
window.location = "http://XXX.XXX.XX.XXX:XXXX/test/AU/jsp/AU000007.jsp";
此工程確定,打開來自新的瀏覽器網頁我的Metro應用
但我想添加使用jcrypto加密的幾個參數,所以我這樣做:
//message encryption
message = jcrypto(message);
message = "http://XXX.XXX.XX.XXX:XXXX/test/AU/jsp/AU000007.jsp?data=" + message;
window.location = message;
,但它只是打開我的metro應用的鏈接,如何解決???
UPDATE:感謝WiredPrairie的建議,我發現了這樣的回答:
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"); }
});
你爲什麼不使用'LaunchUriAsync'啓動網頁? – WiredPrairie
感謝您更新我的文章與您的解決方案 – Jesus