我正在嘗試使用 JavaScript 代碼從 cshtml 視圖呼叫 LaunchUriAsync。下面是我的代碼。
try {
let appStatus = Windows.System.Launcher.LaunchUriAsync(new Windows.Foundation.Uri("https://www.google.com")).done(
function (success) {
console.log("launch complete");
if (success) {
console.log("launch success")
} else {
console.log("launch failed")
}
}, function (err) {
console.log("launch error")
});
}
catch (ex) {
console.log("launch throws")
console.log(JSON.stringify(ex))
}
我得到了輸出“啟動拋出”,但我得到了空例外記錄到控制臺,所以我并沒有真正理解拋出的例外是什么。知道為什么這可能會拋出嗎?
uj5u.com熱心網友回復:
l aunchUriAsync 使用小寫l作業:
Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri("https://www.google.com"))
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/410856.html
標籤:
