I am using jQuery Mobile primarily in building this site, but I've included jQuery UI for a few features missing from Mobile such as a date picker (for a part of the site primarily accessed form desktop). Everything works fine when loading the page directly, but I can't actually navigate to the page from elsewhere in the site - the AJAX loading spinner just spins. I see an error in the console: TypeError: $(...).datepicker is not a function
. I assume this is related to the AJAX page loading of jQuery Mobile and that the fix is related to the pageinit
info in the API info, but I lack the understanding to apply this.
In other words, how do I turn <script> $("#mydatepicker").datepicker(); </script>
into something that works on pageinit
?
Edit: Page head as requested:
<head>
<meta charset="utf-8">
<title>Test Site</title>
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="cleartype" content="on">
<link rel="stylesheet" href="_css/normalize.css" />
<link rel="stylesheet" href="_css/red_ui_variant/jquery-ui-1.10.3.custom.min.css" />
<link rel="stylesheet" href="_css/jquery.mobile.structure-1.3.1.css" />
<link rel="stylesheet" href="_css/red_mobile_variant.css" />
<link rel="stylesheet" href="_libraries/foundation-4.1.5.custom/css/foundation.css" />
<link rel="stylesheet" href="_css/main.css" />
<script src="_scripts/vendor/custom.modernizr.js"></script>
<script src="ckeditor/ckeditor.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="_scripts/jquery-migrate-1.1.1.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
</head>