0

iOS phonegap アプリケーションに外部 URL を読み込もうとしています。

私はindex.htmlでこれを使用しています:

<!DOCTYPE html>
<html>
    <head>
        <title>window.open Example</title>

        <script src="cordova-2.1.0.js"></script>
        <script src="js/plugins/PushNotification.js"></script>
        <script type="text/javascript" charset="utf-8">

            // Wait for Cordova to load
            //
            document.addEventListener("deviceready", onDeviceReady, false);

            // Cordova is ready
            //
            function onDeviceReady() {
                // external url
                var ref = window.open(encodeURI('http://apache.org'), '_blank', 'location=yes');
                // relative document
                ref = window.open('next.html', '_self');
            }

            </script>
    </head>
    <body>
    </body>
</html>

ただし、エラーが発生します:

Failed to load webpage with error: The requested URL was not found on this server.

** OpenAllWhitelistURLsInWebViewcordoba.plist の を yes に変更しました。

何か案が??

4

1 に答える 1

0

www フォルダに next.html がありますか? あなたのコードは apache.org を読み込もうとしていて、それが読み込まれるのを待たずに next.html を読み込もうとしています。www フォルダーに next.html が存在しない場合、このエラーが発生します。

于 2013-03-08T19:31:18.647 に答える