我有这个错误:$(...).datepicker不是一个函数

编程入门 行业动态 更新时间:2024-10-27 22:34:11
本文介绍了我有这个错误:$(...).datepicker不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试使用日期选择器,但是它不起作用.

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

我遇到此错误:$(...).datepicker不是函数

I have this error : $(...).datepicker is not a function

我使用许多框架和库(Adminlte,bootstrap,chartjs,datatable).而且我认为它们之间存在冲突.

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

$(document).ready(function() { $('#datepicker').datepicker(); $('#datepicker').on("changeDate", function() { $('#my_hidden_input').val( $('#datepicker').datepicker('getFormattedDate') ); }); });

<!DOCTYPE html> <html lang="fr"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>AdminLTE 2 | Dashboard</title> <!-- Tell the browser to be responsive to screen width --> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <!-- Bootstrap 3.3.6 --> <link rel="stylesheet" href="./css/bootstrap.min.css"> <!-- Font Awesome --> <link rel="stylesheet" href="cdnjs.cloudflare/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"> <!-- Ionicons --> <link rel="stylesheet" href="cdnjs.cloudflare/ajax/libs/ionicons/2.0.1/css/ionicons.min.css"> <!-- Theme style --> <link rel="stylesheet" href="./css/AdminLTE.min.css"> <!-- AdminLTE Skins. Choose a skin from the css/skins folder instead of downloading all of them to reduce the load. --> <link rel="stylesheet" href="./css/skin-black-light.css"> <!-- CSS Table --> <link rel="stylesheet" href="cdn.datatables/1.10.12/css/jquery.dataTables.min.css"> <!-- My Style --> <link rel="stylesheet" href="./css/style_general.css"> <link rel="stylesheet" href="./css/style.css"> <link rel="stylesheet/less" type="text/css" href="./less/dropdown.less" /> <link rel="stylesheet/less" type="text/css" href="./less/sprites.less" /> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="oss.maxcdn/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="oss.maxcdn/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body class="hold-transition skin-blue sidebar-mini fixed"> <div class="form-group"> <label>Date</label> <div class="input-group date margin-bottom-10" id="datetimepicker1"> <input type="text" class="form-control" id="date" name="date" placeholder="DD/MM/YYY"> <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> </div> </div> <!-- jQuery 2.2.3 --> <script src="code.jquery/jquery-2.2.3.min.js"></script> <!-- Bootstrap 3.3.6 --> <script src="./js/bootstrap.min.js"></script> <!-- AdminLTE App --> <script src="./js/app.min.js"></script> <!-- ChartJS 1.0.1 --> <script src="./js/Chart.min.js"></script> <!-- AdminLTE for demo purposes --> <script src="./js/demo.js"></script> <!-- SlimScroll 1.3.0 --> <script src="./js/jquery.slimscroll.min.js"></script> <!-- JS table --> <script src="cdn.datatables/1.10.12/js/jquery.dataTables.min.js"></script> <script src="./js/test_table.js"></script> <script src="./js/js.js"></script> </body> </html>

推荐答案

我认为 datepicker 在JQuery UI中可用,但您没有包括这些库文件.当我包含以下文件时,没有这样的错误 $(...).datepicker

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

请包括这些文件并检查 [link] code.jquery/ui/1.12. 1/jquery-ui.js [link] code.jquery/ui/1.12.1/themes/base/jquery-ui.css

please include these file and check [link] code.jquery/ui/1.12.1/jquery-ui.js [link] code.jquery/ui/1.12.1/themes/base/jquery-ui.css

更多推荐

我有这个错误:$(...).datepicker不是一个函数

本文发布于:2023-07-26 11:48:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1216026.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我有   错误   一个函数   datepicker

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!