私は現在、IOS で JQuery を使用して phonegap を作成する作業を行っています。
Phonegap からの最初のページは index.html で、他のページはリモート サーバーの外部 Web ページであり、iframe タグを介して表示されます。
WebView に表示されている外部 Web ページから Phonegap で InAppBrowser を開きたい。
そのために、次のようにWebページにソースコードを書きました。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<script type="text/javascript" charset="utf-8" src="cordova-2.5.0.js"></script>
<script type="text/javascript">
function onBodyLoad(){
document.addEventListener("deviceready", onDeviceReady, false);
}
function onDeviceReady(){
alert(" remote page ready!");
}
}
</script>
<title>Hello World</title>
<script>
function move_temp()
{
window.open("http://www.google.com","_blank","location=no");
}
</script>
</head>
<body onload="onBodyLoad()">
<p> THIS IS REMOTE PAGE!</p>
<a href="javascript:move_temp();">erwjkl</a>
</div>
</div>
</body>
</html>
phonegap のホワイトリスト設定は「*」なので、ホワイトリスト ポリシーに関しては問題ありません。
onDeviceReady 関数が起動していないようです。したがって、Web ページは、InAppBrowser モジュールを使用するために必要なネイティブ レベルにバインドされません。
解決策は何ですか?
前もって感謝します :)