Monday, July 20, 2015

jQuery datepicker() Uncaught TypeError: undefined is not a function


Can anyone please help me I am struggling with this problem for the past few day. Actually I included all the necessary plugins' but still the
$('#datepicker').datepicker() function is not defined ERROR.
I included the same plugins' in the other jsp of my projects there the datepicker works perfectly.
This is what I tried.
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">

$( '#datepicker' ).datepicker();
solved :
Please double check the js files you include if you include the same js file twice are different version of same file twice, It will conflict. Have patient to go through to entire jsp or html file to check the js files.
also do this :
jQuery(document).ready(function(){
    $('#Yourdatepicker').datepicker();

});

MS in Computer Science with paid training in USA company