Reputation: 463
Hi there i am trying to implement a basic timepicker example and I encounter:
Uncaught Type Error: Object[object Object] has no method timepicker
Code:
<!DOCTYPE html>
<html>
<head>
<link type="text/css" href="js/jquery.ui.timepicker.css" rel="stylesheet" />
<!--<script type="text/javascript" src="js/jquery.ui.timepicker.js"></script>-->
<script type="text/javascript" src="js/jquery.timepicker.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#id1').timepicker();
});
</script>
</head>
<body>
Input: <input id="id1" type="text" name="fullname"><br>
</body>
</html>
Upvotes: 0
Views: 1443
Reputation: 104775
Load jQuery first!
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.timepicker.min.js"></script>
Upvotes: 0
Reputation: 11371
The order of priority must be the following:
It looks like you got that wrong (looking at your code in the question). Change it to this:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.timepicker.min.js"></script>
Upvotes: 2