Hi i’m trying an simple jquery ui example but it is not working and i dont understand why. can anybody help me? thx
<html><head>
<script type="text/javascript" src="jquery-ui-1.8.23.custom.min.js"></script>
<script type="text/javascript" src="jquery-1.8.0.js"></script>
<link rel="stylesheet" type="text/css" href="jquery-ui-1.8.23.custom.css">
<script type="text/javascript">
$(function(){
$('#datepicker').datepicker({
inline: true
});
});
</script>
</head>
<body>
<input type="text" id="datepicker" class="datepicker">
</body>
</html>
I really dont understand why its not working. all the includes are in the same folder can be found by clicking the link in my sourcecode view of mozilla firefox browser 15.0
jQuery-ui.jsshould be imported afterjQuery.js?Since you’re using firefox I recommend firebug console. It will show you any errors your javascript throws.
Under normal conditions when the browser encounters a script tag it will begin downloading it and puting it in a queue for execution. So the code of jQuery-ui will be executed before the code in jQuery and since the ui frameworks references jQuery it will throw an exeption.
There are multiple solutions to enable out of order execution but the simplest is to make sure all the dependency files are loaded before the ones that need them.