2017-12-27 828 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"; 


        } 
     }