【问题标题】:jquery.mobile-1.4.5.min.css not working in android webview after latest android upgrade (Marshmallow)jquery.mobile-1.4.5.min.css 在最新的 android 升级(棉花糖)后无法在 android webview 中工作
【发布时间】:2015-11-01 09:22:49
【问题描述】:

我使用 JQuery 设计了一个网页。我能够在 Android Webview 中加载页面。该页面已在设备 (Nexus 5) 上正确呈现。

在最近为 Nexus 5 更新 Android(到 Marshmallow)后,我无法在 WebView 上查看网页。我只是在 Webview 的中心看到一个小圆圈。

同样适用于运行旧版 Android 的设备。

调试时我发现删除该行后 - “link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min. css"",页面正在显示。但我需要 css 文件以正确的方式设计页面。

对此的任何帮助将不胜感激。

【问题讨论】:

    标签: android jquery html css webview


    【解决方案1】:

    解决了这个问题。 需要在行前添加以下行(来自Uncaught SecurityError: Failed to execute 'replaceState' on 'History': cannot be created in a document with origin 'null')-"

    <script>
        $(document).bind('mobileinit',function(){
            $.mobile.changePage.defaults.changeHash = false;
            $.mobile.hashListeningEnabled = false;
            $.mobile.pushStateEnabled = false;
        });
    </script>
    

    【讨论】:

      猜你喜欢
      • 2016-01-23
      • 2019-09-04
      • 2016-04-26
      • 1970-01-01
      • 2016-02-06
      • 2016-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多