【发布时间】:2012-07-17 08:39:54
【问题描述】:
我在 xcode 4.3.3 中使用 Cordova 1.8.1 并尝试将 ChildBrowser 插件添加到我的 phonegap 应用程序中。我正在使用的 ChildBrowser 插件是 here 我认为这是 ChildBrowser 的最新版本,我关注教程here 确保它可以在iOS Simulator 5.1 上运行,但无法打开链接。
这是我的示例 index.html 代码....
<script type="text/javascript" charset="utf-8" src="childbrowser.js"></script>
<script type="text/javascript">
var childbrowser;
function onBodyLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady() {
navigator.notification.alert("Cordova is working");
}
function onLinkClick() {
window.plugins.childBrowser.onLocationChange = function(loc){ alert("In index.html new loc = " + loc); };
window.plugins.childBrowser.onClose = function(){alert("In index.html child browser closed");};
window.plugins.childBrowser.onOpenExternal = function(){alert("In index.html onOpenExternal");};
window.plugins.childBrowser.showWebPage('http://www.google.com',
{ showLocationBar: true });
console.log(window.plugins.childBrowser);
}
</script>
有人知道如何让 ChildBrowser 启动并运行吗?
非常感谢任何帮助,谢谢....
【问题讨论】:
标签: ios xcode cordova phonegap-plugins