0π
β
βjQuery is not definedβ means jQuery.js is not loaded.
From looking at your code, it is probably one of the following two reasons:
- The incorrect HTML markup. Try to take away the
<head>
tag around<script>
and<link>
. - The jQuery file included has incorrect path or the file itself is corrupted. Try to replace
/media/js/jquery-1.6.2.min.js
withhttp://code.jquery.com/jquery-1.6.4.min.js
and see if this fixes the problem. If it does, there is something wrong with your jQuery file.
π€William Niu
1π
Mistake is on jquery function. Your date fields class is βinputβ, then jquery should be something like:
$(function() {
$(".input").datepicker({ dateFormat: 'dd/mm/yy' });
π€dani herrera
- [Answered ]-Django namespace NoReverseMatch
- [Answered ]-Changing password in Django using AJAX
- [Answered ]-Pip django app installation
1π
If anyone else is following this trail, I had this same issue and resolved it. Like the original poster, I was loading the JS in the <head><script>
section. It worked when I moved it out of that section and placed it at the bottom of the HTML
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/flick/jquery-ui.css" />
<script>
$(function() {
$( ".datePicker" ).datepicker(); # change ".datePicker" to match your code
});
</script>
π€eezis
- [Answered ]-Django variable in template resulting in SQL query
- [Answered ]-Create many to many relation with query set of another model in Django
Source:stackexchange.com