user1193752
user1193752

Reputation: 239

TypeError: $("#datepicker").datepicker is not a function

Ive read the other questions about this and I know that this is related to date picker not loaded on the page. however I would like to know how to figure out which functions have loaded with JQuery.

The code I'm using is quite basic so I'm not certain why this is failing anyways:

    <script type='text/JavaScript' src='jquery.js'></script>
    <script type='text/JavaScript' src='jquery.ui.core.js'></script>
    <script type='text/JavaScript' src='jquery.ui.widget.js'></script>
    <script type='text/JavaScript' src='jquery.ui.datepicker.js'></script>
    <script src='jquery.validate.js' type='text/javascript'></script>
    <link href='jquery_ui_base\jquery.ui.all.css' rel='stylesheet' type='text/css'>

    <script type='text/javascript'>
           jQuery(function() {
              calender();
              });

        function calender(){
          $( '#datepicker' ).datepicker()
            }
    </script>

Upvotes: 9

Views: 26019

Answers (1)

R.D.
R.D.

Reputation: 1565

this usually happens when the jquery core and/or the datepicker js is not being loaded. check if it's loading (a 200 response). Make sure you have the correct paths and proper read permissions.

also, make sure the jquery core is loaded before the datepicker, and that datepicker is loaded before $( '#datepicker' ).datepicker() .

Also, you could try uploading a new version of datepicker.

Upvotes: 8

Related Questions