0 Replies Latest reply on Dec 19, 2017 5:14 AM by eduqyud3057166

    how to catch http errors in app browser

    eduqyud3057166

      Hello, i am developing an application and loading an hosted application using  the inapp browser plugin cordova-plugin-inappbrowser

       

      I have gotten most of the functionalities to work but i am unable to get the part of loading an error message when he url does not load, it dosent just work and shows me an error message of the url where i have hosted my application instead.

       

      Which could be embarrassing.

       

      please i need help on this

       

      This is what am working with below thanks for ur potential responses

       

      // my child browser code, the main source of my app content function fire(){   var ref = cordova.InAppBrowser.open('http://####################', '_blank', 'location=no,zoom=no,hardwareback=yes,clearsessioncache=yes,clearcache=no'); var myCallback = function(event) { alert(event.url); } ref.addEventListener('loadstart', inAppBrowserbLoadStart); ref.addEventListener('loadstop', inAppBrowserbLoadStop); ref.addEventListener('loaderror', loadErrorCallBack); ref.addEventListener('exit', inAppBrowserbClose); } function loadErrorCallBack(params) {     $('#status-message').text("");     var scriptErrorMesssage =        "alert('Sorry we cannot open that page. Message from the server is : "        + params.message + "');"     inAppBrowserRef.executeScript({ code: scriptErrorMesssage }, executeScriptCallBack);     inAppBrowserRef.close();     inAppBrowserRef = undefined; } function executeScriptCallBack(params) {     if (params[0] == null) {         $('#status-message').text(            "Sorry we couldn't open that page. Message from the server is : '"            + params.message + "'");     } }

      h