不能使datepicker引导工作 [英] Can't make datepicker bootstrap to work
本文介绍了不能使datepicker引导工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我复制并粘贴此网站的第一个示例 http://eonasdan.github.io/bootstrap -datetimepicker / 到我自己的html代码。当我点击文本框旁边的图片时,它不会弹出日历让我选择
<!DOCTYPE html&
< html lang =en>
< head>
< link href =bootstrap / css / bootstrap.min.css =stylesheet>
< / head>
< div class =container>
< div class =row>
< div class ='col-sm-6'>
< div class =form-group>
< div class ='input-group date'id ='datetimepicker1'>
< input type ='text'class =form-control/>
< span class =input-group-addon>< span class =glyphicon glyphicon-calendar>< / span>
< / span>
< / div>
< / div>
< / div>
< script>
$(function(){
$('#datetimepicker1')。datetimepicker();
});
< / script>
< / div>
< / div>
< / body>
< / html>
目录和最新代码,html代码位于LeaveDemo文件夹
我的bootstrap.min.js
我的bootstrap-datepicker.js
错误
$ b b
>
$ b $
<!DOCTYPE html>
< html>
< head>
< title> Datepicker< / title>
< meta http-equiv =Content-Typecontent =text / html; charset = UTF-8>
<! - Bootstrap CSS和bootstrap datepicker CSS用于样式演示页面 - >
< link rel =stylesheethref =css / datepicker.css>
< link rel =stylesheethref =css / bootstrap.css>
< / head>
< body>
< div class =container>
< input type =textplaceholder =点击显示日期戳id =datetimepicker1>
< / div>
<! - 加载jQuery和bootstrap datepicker脚本 - >
< script src =js / jquery-1.9.1.min.js>< / script>
< script src =js / bootstrap-datepicker.js>< / script>
< script type =text / javascript>
//文档准备就绪
$(document).ready(function(){
$('#example1')。datepicker({
format :dd / mm / yyyy
});
});
< / script>
< / body>
< / html>
I copy and paste the first example from this website http://eonasdan.github.io/bootstrap-datetimepicker/ to my own html codes. When I click on the picture beside the textbox, it doesn't pop up the calendar for me to choose
<!DOCTYPE html>
<html lang="en">
<head>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script>
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</div>
</div>
</body>
</html>
Directory and latest code, html codes is in LeaveDemo folder
My bootstrap.min.js
My bootstrap-datepicker.js
Error
解决方案
Can you perhaps try the following code.
Very basic example that is working.
<!DOCTYPE html>
<html>
<head>
<title>Datepicker</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Bootstrap CSS and bootstrap datepicker CSS used for styling the demo pages-->
<link rel="stylesheet" href="css/datepicker.css">
<link rel="stylesheet" href="css/bootstrap.css">
</head>
<body>
<div class="container">
<input type="text" placeholder="Click to show datepicker" id="datetimepicker1">
</div>
<!-- Load jQuery and bootstrap datepicker scripts -->
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script type="text/javascript">
// When the document is ready
$(document).ready(function () {
$('#example1').datepicker({
format: "dd/mm/yyyy"
});
});
</script>
</body>
</html>
这篇关于不能使datepicker引导工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文