【发布时间】:2014-02-04 09:37:22
【问题描述】:
在我的 Phonegap ios 项目中,我有一个 i 框架,而 iframe 的 src 是同一 www 文件夹中的本地 html 页面。在 html(IFrame 源代码)内有一个按钮和 onlick 侦听器。我需要在 InAppBrowser 或 safari(新窗口)中单击该按钮时打开一个网站。我无法从 html 文件(IFrame 源)访问 phonegap 方法,我在两个 html 文件中都包含了cordova,下面给出了我的源 html 页面,此页面显示在 Iframe 中。
<html>
<head>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script src="js/libs/jquery.js"></script>
<script src="adv.js"></script>
<script>
$(document).ready(function () {
$('#advArea').find('button').on('click', function (e) {
e.preventDefault();
var path = "http://www.google.com");
console.log(path);
//window.open(path,'__system');
//need to acces inApp Browser from here
})
});
</script>
</head>
<body>
<div id="advArea">
<button></button>
</div>
</body>
</html>
【问题讨论】:
标签: ios iframe cordova cordova-3 inappbrowser