I've been struggling with an error on my datepicker. It keeps returning the error that the datepicker is not defined. below is the code that I am using. Note that jQuery is already loaded on the page and therefore not needed to be loaded again. I did however load the style that I would like for the date picker. In the end I am going to be adding a callback/return function, but wanted to try and figure out why I am getting this error. Any help would be greatly appreciated.
<html lang="en">
<head>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.css">
</head>
<body>
<div id="datepicker"></div>
</body></html>
<script>
var min=3;
switch (new Date().getDay()) {
case 4:
min = 5;
break;
case 5:
min = 4;
break;
case 6:
min = 3;
break;
}
$( "#datepicker" ).datepicker({
minDate: min,
beforeShowDay: $.datepicker.noWeekends
});
</script>