CordovaWebView: TIMEOUT ERROR

前端 未结 4 948
庸人自扰
庸人自扰 2021-02-15 22:41

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(\"loadUrlTi         


        
4条回答
  •  遇见更好的自我
    2021-02-15 23:28

    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);
    });
    

提交回复
热议问题