cordova - Iframe无法正常工作Phonegap网络错误发生http ://www.digiwebtech.com/Promotion/

标签 cordova error-handling phonegap-plugins phonegap-build

我有一个Phonegap应用程序(android),它是简单的应用程序,它只有一个加载了网址的iframe

网址是-http://www.digiwebtech.com/Promotion/
这个网址在网上可以正常使用,但是当我将此网址作为iframe的来源时,它给出了错误“网络错误已发生http://www.digiwebtech.com/Promotion/

对于构建此应用程序,我正在使用在线Phonegap构建
build.phonegap.com

在这种情况下,我无法理解实际的问题,我所有的代码都在线托管,只有iframe在index.html中

Index.html文件在本地计算机上工作正常

我的Index.html代码-

<!DOCTYPE html>
<!--
    Copyright (c) 2012-2014 Adobe Systems Incorporated. All rights reserved.

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
-->
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="msapplication-tap-highlight" content="no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->

        <link rel="stylesheet" type="text/css" href="css/index.css" />
         <link href="css/splashstyles.css" rel="stylesheet" />
        <title>DigiWebTech</title>
    </head>
    <body>
        <div class="">

<div class="splash fade-in">
        <h1 class="splash-title fade-in"></h1>
        <a href="#" class="splash-arrow fade-in"><img src="~/assets/img/down-arrow.png" /></a>
    </div>


            <div id="content" style="height: auto; width: auto; overflow: auto; -webkit-overflow-scrolling:touch;">
        <iframe class="frame" src="http://www.digiwebtech.com/Promotion/" style="position: absolute;min-width:100%;     min-height: 100%; border: none"   >  </iframe>
</div>
        </div>
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
        <script type="text/javascript">
            app.initialize();

        </script>
          <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="~/assets/js/main.js"></script>
    </body>
</html>

最佳答案

您必须将框架中显示的URL列入白名单。您必须允许在config.xml中导航

关于cordova - Iframe无法正常工作Phonegap网络错误发生http ://www.digiwebtech.com/Promotion/,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34587164/

相关文章:

android - Cordova File Plugin 创建的文件的位置在哪里?

javascript - ons-scroller 和 ons-button 内的 Phonegap

android - 无法在 Android 设备上运行 ionic 应用程序

android - 在安装 Cordova (PhoneGap) 期间,我收到类似 "npm WARN engine Cordova-js@3. 8.0: wanted:..."的警告

java - Android Java开发: App Stopped Working

error-handling - IIS 7.5 : sending http status code 422 with custom errors on

java - 针对用户偏好的phonegap Android 插件

javascript - Phonegap 摄像头和二维码

android - 为什么我的 PhoneGap Android 应用会出现这个错误?

sql - 如何在 vb.net 中使用 try 和 catch block ?