【问题标题】:JQuery Mobile+Phone Gap: index.html file is not opened in Browser but it works fine in iPad simulatorJQuery Mobile+Phone Gap:index.html 文件未在浏览器中打开,但在 iPad 模拟器中运行良好
【发布时间】:2012-05-29 12:55:31
【问题描述】:

我使用 jQuery mobile and phone gap (cordova based application) in iPad 实现了一个应用程序,

我已经使用jQuery实现了index.html页面中的所有视图和代码

when i execute My xcode project works fine it shows required views in simulator.

但是

when i open my index.html file in browsers it doesn't open / shown the views just a blank screen appears why..?

【问题讨论】:

  • iphone 区分大小写,模拟器不区分,已经检查了吗?
  • 我们在inex.html页面中是否区分大小写以在浏览器中打开

标签: jquery android iphone jquery-mobile cordova


【解决方案1】:

我的猜测是你有一些依赖于 Cordova 的代码在“普通”浏览器中失败——检查你的 javascript 错误日志或发布指向你的 html/js 文件的链接。

通常,“deviceready”事件只会在移动设备上触发,因此将依赖 phonegap/cordova 的代码放入文档侦听器中,例如:

  document.addEventListener("deviceready", appReady, false);

并且不要将非 phonegap 代码(例如渲染视图)放入 appReady。

另请参阅: http://docs.phonegap.com/en/1.0.0/phonegap_events_events.md.html#deviceready

->> 乔什·W

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-16
    • 2018-09-12
    • 2012-05-18
    相关资源
    最近更新 更多