jquery mobile和ui不兼容
虽然我有很多人提到类似的兼容性问题,但他们50%的问题都是在StackOverflow上解决的。我希望我的问题能变成51-49:) 考虑以下代码:jquery mobile和ui不兼容,jquery,jquery-ui,jquery-mobile,compatibility,Jquery,Jquery Ui,Jquery Mobile,Compatibility,虽然我有很多人提到类似的兼容性问题,但他们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" />
<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>
你好,世界!
你好
如果你把这个加载到网页上,你会在浏览器中间得到一个灰色的圆圈,并且没有显示“hello”这个词。在web控制台上,您将看到以下内容:未捕获的TypeError:对象0没有方法“匹配”(Chrome)或TypeError:c.match不是函数(Firefox)或脚本438:对象不支持属性或方法“匹配”(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>
jQM复杂演示
你好
您还需要:
<!DOCTYPE html>
这将防止ajax加载程序prom显示:
<div data-role="page" id="index">
Hello
</div>
你好
+1用于
。这真是太棒了——简单的生活技巧!:)