I’ve spent 5 hours just trying to make the loading message show up using jQuery Mobile. Instead, I’m getting:
Uncaught TypeError: Object #<Object> has no method ‘loading’
Here is my code:
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
<script type="text/javascript">
$.mobile.loading("show");
</script>
Here is the current code:
<head>
<title>My Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
<script type="text/javascript">
$.mobile.showPageLoadingMsg();
</script>
</head>
The exception you’re encountering is due to an inaccurate method reference, as stated in the error:
The
loading()method was added in 1.2, but you’re using 1.1.1, which is why it states it does not have aloadingmethod.Usage:
The method that you should be using for your version is
showPageLoadingMsg().Usage: