【发布时间】:2018-05-29 09:41:17
【问题描述】:
我正在尝试在 inappbrowser 中打开 https://www.mywebsite.com/help,然后重定向到 https://www.mywebsite.com/help/residential-customer(假设它是我没有开发控制的第三方页面)。 我隐藏了 inappbrowser,以便在页面加载之前显示加载器
问题:
loadstart 后,loadstop 没有触发,部分设备触发了 loaderror!
var path="https://www.mywebsite.com/help";
var ref = cordova.InAppBrowser.open(path, '_blank', 'toolbarposition=top,closebuttoncaption=Back,location=no,hardwareback=no,hidden=yes');
showLoadingIcon();
//loadstop event
ref.addEventListener('loadstart', function(event) {
//todo
});
//loadstop event
ref.addEventListener('loadstop', function(event) {
hideLoadingIcon();
ref.show();
});
//exit event
ref.addEventListener('exit', function(event) {
hideLoadingIcon();
ref.close();
});
//loaderror event
ref.addEventListener('loaderror', function(event) {
hideLoadingIcon();
ref.close();
showMessage("not happening!");
});
我知道这是第三方页面的问题,但我希望我的应用能够处理它而不是崩溃。
感谢您的帮助。
【问题讨论】:
标签: cordova redirect phonegap inappbrowser