Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CordovaWebView: TIMEOUT ERROR

I am implementing jquery.min.js in my phonegap app but it is showing me the CordovaWebView time out error. I have also tried

super.setIntegerProperty("loadUrlTimeoutValue", 10000);

but it is just taking the time and after that time ,the same "CordovaWebView: TIMEOUT ERROR!" is coming. Please provide me with proper solution.

like image 881
Rawat Raman Avatar asked Jan 24 '13 15:01

Rawat Raman


1 Answers

I guess your main script is too long to execute :

//code executed after the loading of the page (if your using jquery)
$(function() {

    //if this method is too heavy and takes too long to execute, it will trigger the TIMEOUT ERROR. 
    doSomeStuff();
});

Won't may want to add a timeout on this method in order to let the application launch, then start your heavy script (you may want to display a loading image or something like that).

code snippet :

//code executed after the loading of the page
$(function() {

    //in mobile environment, this timeout leaves time for the app to launch before we start any heavy process.
    setTimeout(function(){
        doSomeStuff();
    },100);
});
like image 133
Guian Avatar answered Oct 01 '22 19:10

Guian