gpt4 book ai didi

Android webview 未加载包含资源的完整 html 页面

转载 作者:行者123 更新时间:2023-11-28 01:15:41 26 4
gpt4 key购买 nike

我正在尝试在 webview 的 loadUrl("http://xyc.com/login.html") html 页面的帮助下在 webview 中加载 login.html有以下标签

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Hello </title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--CSS linking -->
<link rel="stylesheet" href="assets/css/jquery.mobile-1.4.2.css" />
<link rel="stylesheet" href="assets/css/jquery-ui.css">
<link rel="stylesheet" href="assets/css/custom.css" />
</head>
<body>
<!-- jquery DOM element goes here-->
</body>
<!--Javascript linking -->
<script src="assets/js/jquery-1.9.1.js"></script>
<script src="assets/js/jquery-ui.js"></script>
<script src="assets/js/jquery.mobile-1.4.2.js"></script>
</html>

jQuery Mobile 中的方法无法始终如一地工作,我想知道是否是因为在 html 页面中加载 jqueryjquery-mobie 插件时的时间问题,或者这是 Android 4.3 webview 中的错误。它仅在 Adroid 4.2 和 4.3 webview 中发生。 Android logcat 显示以下错误

E/Web Console﹕ Uncaught TypeError: Object #<Object> has no method 'remove':12079
E/Web Console﹕ Uncaught TypeError: Object #<Object> has no method 'not':740
E/Web Console﹕ Uncaught TypeError: Object #<Object> has no method 'children':528

最佳答案

你测试这段代码:

   <link rel="stylesheet" href="file:///android_asset/js/jquery.mobile-1.4.2.css">
<script src="file:///android_asset/js/jquery.js"></script>
<script src="file:///android_asset/js/jquery.mobile-1.4.2.js"></script>

或者使用:

   <script>
javascript:loadScript('file:///android_asset/jquery.js','callback')
</script>

关于Android webview 未加载包含资源的完整 html 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35770618/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com