1

I am getting this error when my page loads:

Uncaught TypeError: Object [object Object] has no method 'datepicker'
(anonymous function)
(anonymous function)
b.extend.globalEval
b.fn.extend.domManip
b.fn.extend.append
(anonymous function)
b.extend.access
b.fn.extend.html
(anonymous function)
c
p.fireWith
k
r

Screenshot

enter image description here

I thought it may have to do with a Jquery conflict, so I add $.noConflict(); before the function call. Still I am not sure how can we see if there is Jquery conflict present in our page or not.

Here is my code:

<script src="../js/jquery-1.9.1.min.js"></script>
<script src="../js/jquery-ui-1.10.2.custom.min.js"></script>

<!-- 
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> 
-->

<link type="text/css" href="jquery.datepick.css" rel="stylesheet">
<script type="text/javascript" src="jquery.datepick.js"></script>

<?php
  echo "<script>User();</script>";
?>

<link rel="stylesheet" 
  href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

<script>

  $(function() {
    $( "#fast" ).datepicker();
  });

</script>

<script>
  $(function() {
    $('#modal').draggable({ handle: "p" });
  });
</script>

My major question is how we can see if conflicts exist or not and how to remove them. What does this error mean and how can I fix it?

10
  • 1
    is there a reason why you are using relative paths? Commented Aug 30, 2013 at 17:11
  • Try removing some of the jQuery files and see if it works. Commented Aug 30, 2013 at 17:12
  • @lbu so that everything will be on my server, Commented Aug 30, 2013 at 17:12
  • @putvande point is which one .. Commented Aug 30, 2013 at 17:13
  • Well, you have to try, I can't help you since you have relative files which I don't have. Commented Aug 30, 2013 at 17:14

2 Answers 2

2

I was facing a similar issue because of jQuery conflict and the following fixed it:

Replace

$(function() { $( "#fast" ).datepicker(); });

by

jQuery(function($) { $( "#fast" ).datepicker(); });

Sign up to request clarification or add additional context in comments.

Comments

0

Make sure that you are calling these scripts form a NON-SSL site ,I mean it should be HTTP your site name instead of HTTPS.otherwise it will get blocked

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.