[英]JQUERY UI DatePicker Calendar not showing
我正在研究JQuery UI Date Picker。
在它运作良好之前,但现在日历不会出现。 有任何想法吗?
这是我的代码。 http://pastebin.com/L4j2TmyY
我的代码太长了所以我把它放在pastebin中。
我完全遵循这个,但日历没有显示http://jqueryui.com/datepicker/
正如我看到你的pastebin你正在加载两个jQuery库,这是不推荐的,虽然你可以使用它与jQuery.noConflict()
。 所以快速修复是这样的:
删除此库:
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
我认为您应该将所有JavaScript文件下载到项目文件夹中并调用JavaScript文件。
示例:
从外部URL调用JavaScript(不工作)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>undelegate demo</title>
<style>
button {
margin: 5px;
}
button#theone {
color: red;
background: yellow;
}
</style>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<button id="theone">Does nothing...</button>
<button id="bind">Bind Click</button>
<button id="unbind">Unbind Click</button>
<div style="display:none;">Click!</div>
<script>
function aClick() {
$( "div" ).show().fadeOut( "slow" );
}
$( "#bind" ).click(function() {
$( "body" )
.delegate( "#theone", "click", aClick )
.find( "#theone" ).text( "Can Click!" );
});
$( "#unbind" ).click(function() {
$( "body" )
.undelegate( "#theone", "click", aClick )
.find( "#theone" ).text( "Does nothing..." );
});
</script>
</body>
</html>
从项目文件夹调用(工作正常)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>undelegate demo</title>
<style>
button {
margin: 5px;
}
button#theone {
color: red;
background: yellow;
}
</style>
<script src="jQuery.js"></script>
</head>
<body>
<button id="theone">Does nothing...</button>
<button id="bind">Bind Click</button>
<button id="unbind">Unbind Click</button>
<div style="display:none;">Click!</div>
<script>
function aClick() {
$( "div" ).show().fadeOut( "slow" );
}
$( "#bind" ).click(function() {
$( "body" )
.delegate( "#theone", "click", aClick )
.find( "#theone" ).text( "Can Click!" );
});
$( "#unbind" ).click(function() {
$( "body" )
.undelegate( "#theone", "click", aClick )
.find( "#theone" ).text( "Does nothing..." );
});
</script>
</body>
</html>
@Kim Carlo
我继续@Rohit Bandooni的回答。
作为他的答案,它应该正常工作。
从您的粘贴克隆的pastebin: http : //pastebin.com/2yNiXy44我做了一些更改: - 评论你的2“死” - 更改方法名称(在pastebin中搜索文本“CHANGE_BY_ME”)
我在我的EasyPHP上运行,效果很好: http : //imgur.com/kfmLkLY,lHsEUyv (2个控件的2个图像)我在你的页面上只找到了2个日期控件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.