jQuery UI 日期选择器不会显示 - 包含完整代码 [英] jQuery UI datepicker will not display - full code included
问题描述
我在显示 jQuery 日期选择器时遇到问题,如下所示:http://jqueryui.com/demos/datepicker/
I am having trouble displaying the jQuery datepicker as shown here: http://jqueryui.com/demos/datepicker/
我相信我下载了所有正确的文件,但可以肯定的是,我从头开始并翻录了演示站点.不是全部,但我认为是重要的部分.结果是没有显示日期选择器,也没有 javascript 错误.这是我的完整代码示例:
I believe I downloaded all of the proper files, but to be certain, I started from scratch and ripped the demo site. Not all of it, but what I believed to be the important parts. The result is no datepicker to be shown and no javascript errors. Here is my full code sample:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="http://static.jquery.com/ui/css/base2.css" type="text/css" media="all" />
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" type="text/css" media="all" />
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery(function(){
jQuery("#datepicker").datepicker();
});
</script>
</head>
<body>
<input type="text" id="datepicker" class="hasDatepicker" />
</body>
</html>
非常感谢任何帮助.谢谢!
Any help would be very much appreciated. Thanks!
推荐答案
请从 input 标签中删除 hasDatepicker 类,它应该可以正常工作.
Please remove the class hasDatepicker from input tag and it should work fine.
class = 'hasDatepicker' //Need to remove
这篇关于jQuery UI 日期选择器不会显示 - 包含完整代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!