首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CordovaWebView:超时错误

CordovaWebView:超时错误
EN

Stack Overflow用户
提问于 2013-01-24 23:44:05
回答 4查看 10.4K关注 0票数 8

我在我的phonegap应用程序中实现了jquery.min.js,但它显示了CordovaWebView超时错误。我也试过

代码语言:javascript
复制
super.setIntegerProperty("loadUrlTimeoutValue", 10000);

但是它只是在花时间,在那之后,同样的"CordovaWebView:超时错误!“就要来了。请给我提供适当的解决方案。

EN

回答 4

Stack Overflow用户

发布于 2013-06-10 22:17:25

我猜你的主脚本太长了,不能执行:

代码语言:javascript
复制
//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();
});

我可能不想在这个方法上添加一个超时,以便让应用程序启动,然后启动你的繁重脚本(你可能想要显示一个加载图像或类似的东西)。

代码片段

代码语言:javascript
复制
//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);
});
票数 1
EN

Stack Overflow用户

发布于 2013-03-31 03:02:33

您可以增加超时值,请参阅此link

代码语言:javascript
复制
super.setIntegerProperty("loadUrlTimeoutValue", 60000); 

更新

在示例中,我用下面的代码片段替换了我的旧代码,它可以工作:

我添加了import org.apache.cordova.*,并将super.loadUrl(Config.getStartUrl())代替了url方法

代码语言:javascript
复制
import org.apache.cordova.*;
import android.os.Bundle;    
public class MyApp extends DroidGap
{    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {           
        super.onCreate(savedInstanceState);
        super.loadUrl(Config.getStartUrl());            
    }
票数 0
EN

Stack Overflow用户

发布于 2013-08-01 17:51:22

从相同的AVD重启应用程序将会解决这个问题,不需要给应用程序一个'run as‘命令,只需从手机或AVD中选择应用程序,然后再次运行它可能是因为你的设备非常慢,并且没有对你指定的值识别变量做出快速响应

我-

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14505204

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档