datepicker is not a function что делать

However, when I copy and paste the same code that creates and uses the datePicker to an HTML file that’s also in the same directory as the aspx page, it works flawlessly. This leads me to assume that there are some JS files in the aspx page that’s preventing the datePicker or maybe jQuery’s UI JS files to load properly.

Can anyone confirm my beliefs or provide any tips on finding the culprit that’s interfering with jQuery’s UI plugins?

20 Answers 20

I struggled with a similar problem for hours. It then turned out that jQuery was included twice, once by the program that I was adding a jQuery function to and once by our in-house debugger.

Also make sure your javascript includes are in the correct order so the jquery core library is defined before the jquery.ui. I’ve had that cause issues.

I have fixed the issue by placing the below three files in the body section of the form at the end.

This error usually appears when you’re missing a file from the jQuery UI set.

Double-check that you have all the files, the jQuery UI files as well as the CSS and images, and that they’re in the correctly linked file/directory location on your server.

If you think that there is a conflict you can use jQuery.noConflict() in your code. Details are in the docs.

If you don’t like typing the full «jQuery» all the time, there are some alternative shortcuts:

Note: Again, inside that block you can’t use Prototype methods

Thats from the end of the docs and might be useful to you

Читайте также:  что делает тик ток с людьми

Источник

I try to use a datepicker, but it doesn’t work.

I use many frameworks and librairy (Adminlte, bootstrap, chartjs, datatable). And I think that there is a conflicts between they.

8 Answers 8

Please try it this way. It is working fine. Same object is defined and used by jquery so its conflict try above trick its work fine..

I think datepicker is available in JQuery UI but you didn’t include those library files. when I include the below files there is no such error $(. ).datepicker

Make sure that you include that datapicker.js library on the page that you use it on. Make sure that the link / local file exists. It may be a loaded from a different file if you are using bootstrap / framework.

This is the most common reason.

You can follow like this. This works for me.

The JS coding for the Date Picker I use.

There is no conflict with using jQuery and Datepicker together.

Look for a second instance of jQuery being loaded somewhere.

I have gone through all your js files.

Noted that you are using AdminLTe for your js and css. In that case, check again the the example in Forms > Advanced Elements in left panel.

I think you missed out the bootstrap datepicker: Try searching for this js file in AdminLTe Example:

If datepicker does not work due to conflict jquery, then try this way. It will work.

Источник

Сказочный портал