简体   繁体   English

动态 javascript 日期选择器

[英]dynamic javascript date picker

I have a script for dynamic javascript date picker, taken from here .我有一个用于动态 javascript 日期选择器的脚本,取自此处 Please scroll down to Toggle by Element which i want to implement but it is not working请向下滚动到我想实现的按元素切换,但它不起作用

<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>

edit: i added the following mootools 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>

what i am missing?我错过了什么?

It seems it require mootools, i cant see any mootools script tag in your source.它似乎需要 mootools,我在你的源代码中看不到任何 mootools 脚本标签。 it has nothing to do with jQuery.它与jQuery无关。

edit: here is an exemple:编辑:这是一个例子:

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

put it before the date picker script把它放在日期选择器脚本之前

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM