我将phoneGap嵌入到我的UIWebView中,引用了这个文档: http://docs.phonegap.com/en/2.2.0/guide_cordova-webview_ios.md.html#Embedding%20Cordova%20WebView%20on%20iOS
在index.html中,我编写了以下示例代码:
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
alert(“jquery loaded”);
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Click me</button>
</body>
webview加载后,可以显示“body”,但无法弹出alert。那么 jquery.js 没有加载?还是有其他问题?
编辑: 我在 src 中添加了“http:”,但不起作用。
谢谢!
最佳答案
改变
alert(“jquery loaded”);
至
alert("jquery loaded");
或
alert('jquery loaded');
关于ios - 我无法在ios uiwebview中的phoneGap中加载JQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15783687/