JQUERY UI DatePicker日历不显示
我正在使用JQuery UI Date Picker。JQUERY UI DatePicker日历不显示
之前工作很好,但现在的日历不会显示出来。 有什么想法?
这是我的代码。 http://pastebin.com/L4j2TmyY
我的代码太长,所以我把它放在pastebin中。
我遵循这个确切,但日历未显示 http://jqueryui.com/datepicker/
我想你应该下载所有的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>
,因为我看到你的引擎收录你同时加载两个jQuery的图书馆,这是不推荐的,但可以用jQuery.noConflict()
使用它。所以速战速决是这样的:
删除这个库:
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
这也不工作..我一直在为此工作近8小时..我无法找到错误的位置是。 – 2014-12-03 10:26:49
@KimCarlo您可以检出浏览器控制台中可用的任何js错误。 – Jai 2014-12-03 10:31:36
这里是控制台的屏幕截图 https://drive.google.com/file/d/0BwkoZTNT2pYwb0lUMGJ1dkZZUmM/view?usp=sharing – 2014-12-03 10:43:16
@Kim卡罗
我继续@Rohit Bandooni的回答。
作为他的回答,它应该正常工作。
从糊克隆了引擎收录:http://pastebin.com/2yNiXy44 我做了一些变化: - 评你2“模具” - (在引擎收录搜索文本“CHANGE_BY_ME”)更改方法名
我上运行我的EasyPHP,它运作良好:http://imgur.com/kfmLkLY,lHsEUyv(2个控件的图像) 我在您的页面上只找到2个日期控件。
您正在使用datepick() 正确的方法是datepicker() – 2014-12-03 10:18:13
是的。我已经将它更改为datepicker(),但仍然不显示。 – 2014-12-03 10:24:19
检查控制台(F12)并查看它说的是什么。 – fritsMaister 2014-12-03 10:45:57