JQuery DatePicker not loading

I have a jQuery piece that for some reason will not load. I am wondering if this is a mistake in my syntax or if I am missing something important for its operation. This is placed on the page that is included.

<script> jQuery(function() { jQuery( "#datepicker" ).datepicker(); }); </script> <div class="demo"> <p>Date: <input type="text" id="datepicker"></p> <?php echo "hello world againagain!"; ?> </div> 

This is in the index.php header: / css / ui-lightness / jquery-ui-1.8.16.custom.css "rel =" Stylesheet "/">

 <script src="<?php echo $intranetName; ?>/js/jquery_1_6.js" type="text/javascript"></script> <script type="text/javascript" src="<?php echo $intranetName; ?>/js/jquery-ui- 1.8.16.custom.min.js"></script> 

intranetName loads the script domain. It loads scripts and shows the correct path in the html source, so I don't think this is a problem. However, I'm still new to jQuery. Please help me! Thanks.

I get it. This was due to damage to my copy of jQuery. Thanks everyone!

+2
source share
3 answers

Enable JQuery before JQuery-UI

 <script src="<?php echo $intranetName; ?>/js/jquery_1_6.js" type="text/javascript"></script> <script type="text/javascript" src="<?php echo $intranetName; ?>/js/jquery-ui-1.8.16.custom.min.js"></script> 

EDIT:

This works fine on my local machine (i.e. shows datepicker without css):

 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script> <script> jQuery(function() { jQuery( "#datepicker" ).datepicker(); }); </script> <div class="demo"> <p>Date: <input type="text" id="datepicker"></p> 

Therefore, this is a problem with your user interface package.

+5
source
 <script> jQuery(document).ready(function() { jQuery( "#datepicker" ).datepicker(); }); </script> 
+2
source

You are using a customized version of jQuery ( 1.8.16.custom.min.js ).

Make sure you include the Datepicker widget in your customized version of the JavaScript file.

Keep in mind that Datepicker is inside the Widget group: http://jqueryui.com/download

+1
source

Source: https://habr.com/ru/post/1379846/


All Articles