【问题标题】:iFrame not working in jQuery Mobile (Phone Gap)iFrame 在 jQuery Mobile 中不起作用(电话差距)
【发布时间】:2015-11-26 21:09:09
【问题描述】:

我的代码是:

<div data-role="page" id="pageID">


    <div data-role="header"  data-position="fixed">
        <p>Directions</p>
    </div>


    <div data-role="content">

        <div style="width:100%; height:80%;">
            <iframe src="http://m.google.com"  seamless=""></iframe>     
        </div>

    </div> 

</div> 

但是当我来到这个页面时,谷歌没有加载。我正在三星 Galaxy S Android 手机上试用。

【问题讨论】:

    标签: android jquery html cordova jquery-mobile


    【解决方案1】:

    这个 iframe 对我有用,但有列表问题

    <iframe name="frame" src="http://google.com" frameborder="0" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:100%;width:100%;position:absolute;top:0px;left:0px;right:0px;bottom:0px">
        </iframe>'
    

    【讨论】:

      【解决方案2】:

      不要在手机上使用 iFrame 和 JQM。 iFrame 不适用于某些内置的 android 浏览器。您是否尝试在移动 chrome 或 firefox 浏览器上对其进行测试?

      最坏的情况使用this 组件代替。这是一个phonegap插件,用于显示新的浏览器窗口。

      This 示例应该可以工作。我已经在我的 Galaxy S3 上测试过了。

      <iframe style="width: 400px; height: 400px" src="http://m.google.com" frameborder="0" scrolling="no"></iframe>
      

      【讨论】:

      • 它在系统浏览器中工作......但我希望它在 android 中运行
      • 有没有其他方法可以做上述操作
      • 不,伙计......它不工作......我猜 S3 它将工作,因为它有一个更好的网络工具包,甚至支持页面转换动画......但对于 Android 2.X 它是问题...有什么办法让它在 Android 2.X 中工作...谢谢
      【解决方案3】:

      阻止网址也可能有问题.. 如果您使用 phonegap build.. 将以下行添加到 config.xml。

      参考链接:http://docs.build.phonegap.com/en_US/#googtrans(en) 配置块..

      <plugin name="cordova-plugin-whitelist" version="1"/>
      <allow-intent href="http://*/*"/>
      <allow-intent href="https://*/*"/>
      <allow-intent href="tel:*"/>
      <allow-intent href="sms:*"/>
      <allow-intent href="mailto:*"/>
      <allow-intent href="geo:*"/>
      <platform name="android">
          <allow-intent href="market:*"/>
      </platform>
      <platform name="ios">
          <allow-intent href="itms:*"/>
          <allow-intent href="itms-apps:*"/>
      </platform>
      

      确保&lt;plugin name="cordova-plugin-whitelist" version="1"/&gt;添加了这个..

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-05-15
        • 1970-01-01
        • 1970-01-01
        • 2012-05-21
        • 1970-01-01
        • 2014-06-15
        • 2012-05-10
        • 2013-05-05
        相关资源
        最近更新 更多