我在打開 url 時遇到InAppBrowser問題Cordova。我有以下代碼:
if (device.platform.toUpperCase() === 'IOS'){
let url = "http://192.168.1.115:5000/Home/GetQRCode?value=" value;
url = url.replace(/\\/g, '|');
alert(url);
ref = window.open(url, '_system', inAppBrowserOptions);
}
我認為 url 不能在 url 上有反斜杠,iOS所以我用管道替換了它們。那也沒有用。在我閱讀 QRCode 后,該應用程式仍然保持不變,這意味著它沒有打開頁面,并且它保留在我的索引頁面上,我有啟影片面。我該如何解決這個問題?
uj5u.com熱心網友回復:
管道和反斜杠在 URL 中不受支持/有效,此外您應該使用編碼您的 URL(或您的查詢字串)
encodeURIComponent()
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/457785.html
