Although I have a ton of people referencing to similar compatibility issues, 50% their problems are solved on StackOverflow. I am hoping my question will make it 51-49 :)
Consider this code:
<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>
If you load this on a web page, you will get a grey circle in the middle of the browser and the word "Hello" is not displayed. On the web console, you'll see the following: Uncaught TypeError: Object 0 has no method 'match' (Chrome) or TypeError: c.match is not a function (Firefox) or SCRIPT438: Object doesn't support property or method 'match' (IE).
Is it a bad idea to want to use both jquery-ui and jquery-mobile on a page together, or am I doing something wrong?
Only thing relevant is an order, load jQM after jUI, same thing goes for css files:
<!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>
Also you need:
<!DOCTYPE html>
And this will prevent ajax loader prom showing:
<div data-role="page" id="index">
Hello
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With