phonegap,连接服务器失败 [英] phonegap, connection to server unsuccessful

查看:24
本文介绍了phonegap,连接服务器失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 phonegap 编写一个 Android 应用程序,我正在编写一个带有按钮的静态首页,在我引入 jQuery mobile 和 jQuery(它们作为外部文件链接)之前,它一直在工作.现在,它给了我这个错误信息(在它产生一个空白窗口 30 秒左右之后):

I'm trying to write an Android app with phonegap, and I'm writing a static front page with buttons, which was working until I introduced jQuery mobile and jQuery (which are linked as external files). Now, it gives me this error message (after it produces a blank window for 30 seconds or so):

连接到www/assets/index.html"的服务器失败

Connection to server was unsuccessful to "www/assets/index.html"

由于消息一闪而过,我无法再阅读了.有什么帮助吗?

Since the message flashes away, I cannot read anymore. Any help?

推荐答案

链接为外部文件"究竟是什么意思?

What exactly do you mean by "linked as external files"?

jQuery Mobile 和 jQuery 源要么需要位于 assets/www 目录中,要么链接到可访问的 CDN 站点上并启用无线或移动数据.

The jQuery Mobile and jQuery sources either need to be in the assets/www directory or linked to externally on an accessible cdn site with wireless or mobile data enabled.

这里有一个示例.

此外,请参阅 Android 版 JQuery Mobile + PhoneGap - 错误加载 index.html - 在调用 super.loadUrl 之前在您的自定义活动文件中添加以下行: super.setIntegerProperty("loadUrlTimeoutValue", 60000);

Also, see JQuery Mobile + PhoneGap for Android - Error loading index.html - Within your custom Activity file before calling super.loadUrl add the following line: super.setIntegerProperty("loadUrlTimeoutValue", 60000);

这篇关于phonegap,连接服务器失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆