Sud*_*jee 4 jquery compatibility jquery-ui jquery-mobile
虽然我有很多人参考类似的兼容性问题,但他们的问题有50%在StackOverflow上得到解决.我希望我的问题能让它成为51-49 :)
考虑以下代码:
<html>
<head>
<title>Hello, world!</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
</head>
<body>
Hello
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
如果您在网页上加载此内容,则会在浏览器中间显示一个灰色圆圈,并且不会显示"Hello"字样.在Web控制台上,您将看到以下内容:未捕获TypeError:对象0没有方法'匹配'(Chrome)或TypeError:c.match不是函数(Firefox)或SCRIPT438:对象不支持属性或方法'匹配'(IE).
想要在页面上同时使用jquery-ui和jquery-mobile是一个坏主意,还是我做错了什么?
唯一相关的是订单,在jUI之后加载jQM,css文件也是如此:
<!DOCTYPE html>
<html>
<head>
<title>jQM Complex Demo</title>
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
<div data-role="page" id="index">
Hello
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
你还需要:
<!DOCTYPE html>
Run Code Online (Sandbox Code Playgroud)
这将阻止ajax loader prom展示:
<div data-role="page" id="index">
Hello
</div>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4434 次 |
| 最近记录: |