仅加载 jquery 3.2.1 或 jquery 移动版 1.4.5,为什么?
Only jquery 3.2.1 or jquery mobile 1.4.5 is being loaded, why?
只有 jquery 或 jquery 手机正在从我的 html 文件中的 head
加载。
如果我在 head
中更改它们的顺序,它会在正在加载的一个之间切换。会不会是兼容性问题?
<head>
<title>blablabla</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="resources/jquery.mobile-1.4.5.min.js"</script>
<script src="resources/jquery-3.2.1.min.js"</script>
<link rel="stylesheet" type="text/css" href="resources/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="js/client.js"></script>
<script src="/socket.io/socket.io.js"></script>
</head>
同时存在加载顺序问题和兼容版本问题。
- 加载顺序:
。这是 jQuery 和 JQM 的正确加载顺序:
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.css">
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
$(document).on('mobileinit', function() {
// JQM Initialization options
});
</script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
- 版本兼容性(来源:[jQuery手机主页:(http://jquerymobile.com/)):
JQM Version 1.4.5 is compatible with jQuery 1.8 - 1.11 / 2.1
只有 jquery 或 jquery 手机正在从我的 html 文件中的 head
加载。
如果我在 head
中更改它们的顺序,它会在正在加载的一个之间切换。会不会是兼容性问题?
<head>
<title>blablabla</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="resources/jquery.mobile-1.4.5.min.js"</script>
<script src="resources/jquery-3.2.1.min.js"</script>
<link rel="stylesheet" type="text/css" href="resources/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="js/client.js"></script>
<script src="/socket.io/socket.io.js"></script>
</head>
同时存在加载顺序问题和兼容版本问题。
- 加载顺序:
。这是 jQuery 和 JQM 的正确加载顺序:
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.css">
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
$(document).on('mobileinit', function() {
// JQM Initialization options
});
</script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
- 版本兼容性(来源:[jQuery手机主页:(http://jquerymobile.com/)):
JQM Version 1.4.5 is compatible with jQuery 1.8 - 1.11 / 2.1