0

我有一个用于动态 javascript 日期选择器的脚本,取自此处。请向下滚动到我想要实现的按元素切换,但它不起作用

<html>
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
     <SCRIPT type="text/javascript" src="js/jquery.min.js"></SCRIPT>

编辑:我添加了以下 mootools 脚本

<script src='http://cdnjs.cloudflare.com/ajax/libs/mootools/1.3.2/mootools-yui-
compressed.js'
type='text/javascript'></script>


      <SCRIPT type="text/javascript" src="datepicker.js"></SCRIPT>
      <SCRIPT type="text/css" src="datepicker.css"></SCRIPT>
      <SCRIPT type="text/css" src="datepicker_vista.css"></SCRIPT>
</head>
 <body>    
 <script language="JavaScript">
   window.addEvent('load', function() {
    new DatePicker('.demo_allow_empty', {
    pickerClass: 'datepicker_dashboard',
    allowEmpty: true
 });
  });
 </script>
<label>Datepicker starting at and allowing no value:</label>
<input name='date_allow_empty' type='text' value='' class='date demo_allow_empty' />
</body>
</html>

我错过了什么?

4

1 回答 1

2

似乎它需要 mootools,我在您的源代码中看不到任何 mootools 脚本标签。它与jQuery无关。

编辑:这是一个例子:

<script src='http://cdnjs.cloudflare.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js'
type='text/javascript'></script>

把它放在日期选择器脚本之前

于 2012-04-09T12:28:52.750 回答