gpt4 book ai didi

jquery-mobile - PhoneGap 和 jQuery Mobile 不适用于 iOS 5?

转载 作者:行者123 更新时间:2023-12-01 02:41:45 24 4
gpt4 key购买 nike

我有一个使用 jQuery Mobile 开发并在 PhoneGap 中实现的简单应用程序。它在 iPad 4.3 模拟器中运行良好,但不适用于 iPad 5.0 模拟器和运行 iOS 5 的实际 iPad...

这是 html 文件的头部部分:

<head>
<meta charset="utf-8"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta content="width=device-width,minimum-scale=1,maximum-scale=1" name="viewport"/>
<link rel="apple-touch-icon" href="icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="icon.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="icon.png"/>
<title>App demo</title>
<link rel="stylesheet" href="scripts/jquery.mobile-1.0rc2.min.css"/>

<link href="css/style.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript" src="scripts/jquery-1.6.4.min.js"/>
<script type="text/javascript" src="scripts/jquery.mobile-1.0rc2.min.js"/>
<script type="text/javascript" src="scripts/general.js"></script>
<script type="text/javascript" src="scripts/app.js"/>
</head>

当我在 iPad 模拟器 4.3 上运行它时,一切都很好。但是在 5.0 上它只显示一个空白屏幕。与带有 iOS 5 的实际 iPad 相同。但是,如果我删除脚本引用它有点“有效”,因为它显示了 HTML 页面的内容,但当然没有 jQuery Mobile 的样式和功能......包括任何 jQuery似乎完全打破了它,例如如果我只留下对 jquery-1.6.4.min.js 的引用,它也不会起作用。或者我的自定义 js 文件之一。

有谁知道这里发生了什么?它与文件引用的位置有关吗?我想我已经把它们按正确的顺序放置了(首先是 jQuery,然后是 jQuery mobile,然后是我的自定义 js)......它似乎永远不会起作用,我试过这个应用程序 http://coenraets.org/blog/2011/10/sample-application-with-jquery-mobile-and-phonegap/这工作正常。它的脚本引用相当奇怪地放置在文件的底部,就在结束正文标记之前。但我也尝试这样做,然后 jQuery Mobile 的东西根本没有启动(尽管我可以看到内容)。

而且,既然它在 4.3 模拟器中工作,我不认为我的代码真的有问题,但为什么它在 5.0 中不起作用?

最佳答案

This question这里堆栈溢出似乎表明 iOS5 中的 UIWebView 需要外部脚本链接具有实际的结束标记,而不是简单地以“/>”结尾。

尝试将链接更改为:

<script type="text/javascript" src="scripts/jquery-1.6.4.min.js"></script>

这有什么改变吗?

关于jquery-mobile - PhoneGap 和 jQuery Mobile 不适用于 iOS 5?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8073567/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com