简体   繁体   中英

Bootstrap DateTimePicker and jQuery problems

I'm trying to use Bootstrap DateTimePicker on a Bootstrap-based HTML template. The problem is that there's a JS file called foundation.js which is included in the template and that file is killing DateTimePicker. When I don't include this file, DateTimePicker works, but lots of other functions of template (like tabs, image gallery etc.) stop working. When this file is included, DateTimePicker doesn't work. That foundation.js file is too big so I put it here: http://pastebin.com/fQhtpV2P

What I noticed is that there is obviously a whole jQuery v1.8.1 code included in that file. So I guess that this is the reason why DateTimePicker doesn't work since I'm including jQuery v2.1.1 library so these two are in conflict. I tried:

  1. Remove the jQuery v1.8.1 code from foundation.js -> the same effect like removing the whole file; the picker works but all other functions from template doesn't work
  2. Remove jQuery v2.1.1 library include -> DateTimePicker doesn't work
  3. Remove the jQuery v1.8.1 code from foundation.js and replace it with jQuery v2.1.1 code -> nothing works

I also tried all combinations of including order, but no success. So, I can't remove that foundation.js and the picker won't work while that file is there. What should I do?

PS. my code is in Codeigniter so it's pretty complicated (in lots of files) but I can give you parts of the code if needed.

Try to use an older version of your picker, u can take a look at this link

http://plugins.jquery.com/datetimepicker/

The picker simply doesn't show with jQuery 1.8 or give u an error??

Regards

Uncaught TypeError: $(...).datetimepicker is not a function

This kind of error is communly caused because you included the library that is depending on jquery before jquery itself.

Check your including order to be sure the dateTimePicker js file is included after JQuery

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM