简体   繁体   English

如何使用Datepicker JavaScript

[英]How to use datepicker javascript

I had visited this site: 我曾浏览过这个网站:

http://www.monkeyphysics.com/mootools/script/2/datepicker http://www.monkeyphysics.com/mootools/script/2/datepicker

I followed exactly (I guess) what he said on that site, but still not working. 我完全按照(我猜)他在那个网站上说的去做,但仍然没有用。 Here's my code: 这是我的代码:

<!DOCTYPE html>
<html>
<script type="text/javascript" src="js/datepicker.js"></script>
<link rel="stylesheet" href="css/datepicker_jqui.css">        
<style type="text/css">     
input.date {
    width: 150px;
    color: #000;
}
</style>    
<head>
    <title></title>
</head>
<body>
<label>Datepicker with Vista skin:</label>
<input name='date_B' type='text' value='' class='date demo_vista' />

<label>Datepicker with OSX Dashboard skin:</label>
<input name='date_B' type='text' value='' class='date demo_dashboard' />

<label>Datepicker with jQuery UI skin:</label>
<input name='date_B' type='text' value='' class='date demo_jqui' />

<label>Datepicker basic (CSS only):</label>
<input name='date_B' type='text' value='' class='date demo' />

<script type="text/javascript"> 
window.addEvent('load', function() {
    new DatePicker('.demo_vista', { pickerClass: 'datepicker_vista' });
    new DatePicker('.demo_dashboard', { pickerClass: 'datepicker_dashboard' });
    new DatePicker('.demo_jqui', { pickerClass: 'datepicker_jqui', positionOffset: { x: 0, y: 5 } });
    new DatePicker('.demo', { positionOffset: { x: 0, y: 5 }});
});    
</script>    
</body>
</html>

anyone have idea what is wrong with my code, please help 任何人都知道我的代码有什么问题,请帮助

thank you 谢谢

Actually You're not including your assets. 实际上,您不包括资产。 You have to put your links, stylesheets and js files inside the head tag. 您必须将链接,样式表和js文件放在head标签内。

<html>
<head>
    <title></title>
    <script type="text/javascript" src="js/datepicker.js"></script>
    <link rel="stylesheet" href="css/datepicker_jqui.css">        
    <style type="text/css">     
        input.date {
            width: 150px;
            color: #000;
        }
    </style>    
</head>

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

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