2
<!doctype html>
<html lang="en">
<head>

<meta charset="utf-8">
<meta content='width=device-width, initial-scale=1' name='viewport'/>
  <title>jQuery UI Datepicker</title>

  <link type="text/css" href="jquery-ui-1.8.16.custom/css/sunny/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
  <script src="jquery-ui-1.8.16.custom/js/jquery-1.6.2.min.js"></script>

  <script scrc="jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script>
</head>
<body>
  <h3>Date of Birth</h3>
  <input type="text" name="birth_date" id="datepicker">
  <script>
      $(document).ready(function(){
          $('#datepicker').datepicker();
      });
  </script>
</body>
</html>

Why this doesn't work ? tried several times but get the same error in debug:

Object doesn't support property or method 'datepicker'.

3
  • It seems that you didn't include datepicker.js and jquery-ui library. Commented Sep 27, 2014 at 12:24
  • i think there is versioning problem in jquery.js and jquery-ui..just include their latest releases. Commented Sep 27, 2014 at 12:28
  • Are you using jQuery 1.6?? If yes then I am not sure whether it supports date picker or not. Update jQuery plugin at least 1.7.2 and it will work jsfiddle.net/dimomohit/2js1cykh. Hope this helps you.
    – DimoMohit
    Commented Sep 27, 2014 at 12:31

2 Answers 2

1

Looks like you have a typo here

<script scrc="jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script>
---------^

scrc should be changed to src

<script src="jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script>
1
  • Thanks. It was indeed a typo. Works fine now.
    – ranjan
    Commented Sep 27, 2014 at 12:54
0

try this fiddle Demo - here , in your code check the included scripts are loaded properly, or check the console any error showing

<link type="text/css" href="jquery-ui-1.8.16.custom/css/sunny/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
  <script src="jquery-ui-1.8.16.custom/js/jquery-1.6.2.min.js"></script>

  <script src="jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script>
</head>

Not the answer you're looking for? Browse other questions tagged or ask your own question.