2017-12-27 838 views
0

我正在使用Cordova和InAppBrowser插件在我的应用程序(android)中查看外部链接。但是,当设备没有连接,我想去外部链接它显示Android错误(见图片)。在科尔多瓦更改错误图像

问题: 如何将此标准错误页面(standard error image)更改为我的自定义错误页面?

非常感谢

回答

1

使用这样的:

document.addEventListener("deviceready", onDeviceReady, false); 
     function onDeviceReady() { 
      if(navigator.onLine) { 
        var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=yes'); 
        ref.show(); 
        } else { 
        //create page in folder www like index2.html and include 
         alert("No Internet Pleas active your internet"); 
         window.location = "index2.html"; 


        } 
     }