单击按钮时未填充 Jquery Datepicker?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link type="text/css" href="Styles/Site.css" rel="Stylesheet" ></link >
<script type="text/javascript" src="Scripts/jquery-1.4.1-vsdoc.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
var textBox = $('#mdatepicker');
var icon = $('#myButton');
var mydatepicker = textBox.datepicker();
icon.click(function () {
mydatepicker.datepicker("show");
});
});
</script>;
<form id="form1" runat="server">
<input type="text" id="mdatepicker" value="date" />
<input type="button" id="myButton" value="PopUp"/>
</form>
</body>
</html>
这个 html 片段中是否缺少任何内容??
datepicker 未填充,ErrorConsole 显示错误 -
'textBox.datepicker is not a function'
在下面的代码中;
var mydatepicker = var mydatepicker = textBox.datepicker();
有人可以帮忙吗?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link type="text/css" href="Styles/Site.css" rel="Stylesheet" ></link >
<script type="text/javascript" src="Scripts/jquery-1.4.1-vsdoc.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
var textBox = $('#mdatepicker');
var icon = $('#myButton');
var mydatepicker = textBox.datepicker();
icon.click(function () {
mydatepicker.datepicker("show");
});
});
</script>;
<form id="form1" runat="server">
<input type="text" id="mdatepicker" value="date" />
<input type="button" id="myButton" value="PopUp"/>
</form>
</body>
</html>
Is there anything missing in this html snippet .??
datepicker is not getting populated, ErrorConsole showing error that-
'textBox.datepicker is not a function'
in below code;
var mydatepicker = var mydatepicker = textBox.datepicker();
Can someone help please.?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是我的代码的工作副本。
Thats my working copy of your code.
datepicker
不是 jQuery-UI 库中的函数吗?如果是这样,那么您需要包含对 jQuery-UI 库的脚本引用。
编辑
否 您需要添加对 jQuery-UI 库和 jQuery-UI Css 文件的脚本引用
Is
datepicker
not a function from the jQuery-UI library?If so, then you need to include a script reference to the jQuery-UI Library.
EDITS
No You need to add a script reference to the jQuery-UI library and jQuery-UI Css file
您是否提供了 js 文件的完整参考?包括jquery和datepicker的.js文件。
问题在于:
我在您的 head 标记中看不到任何有关 datepicker 的 js 文件,其中您已包含所有 js 引用。
必须有一些文件,如:
或类似的文件,您缺少包含这些文件。
希望这有帮助。
Are you giving full refrences to js files. Including jquery and datepicker's .js files.
The issue is in this:
I can not see any js files regarding datepicker in your head tag where you've included all js refrences.
There must be some file like:
or something like that, which you are missing to include.
Hope this helps.
如果你使用jquery datepicker,'myButton'对象不是必需的,datepicker会处理它以供使用,请参阅代码:
if you use jquery datepicker, the 'myButton' object is not necessary, datepicker will handle it for use, see the code: