简体   繁体   English

日期选择器js不起作用?

[英]date picker js didn't work?

I want to use date picker with js and it's work in some page with some code as same as this page but in this page it didn't work. 我想将日期选择器与js一起使用,因此它可以在某些页面中与该页面相同的代码工作,但在此页面中却无法使用。 i wish someone can help me with that 我希望有人可以帮助我

here is my code: 这是我的代码:

 <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" type="text/css" media="all" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $('#txtDate').datepicker({ dateFormat: 'yy-mm-dd' }).val(); $('#txtDate').datepicker(); }); </script> <script src="http://cdn.jsdelivr.net/webshim/1.12.4/extras/modernizr-custom.js"></script> <!-- polyfiller file to detect and load polyfills --> <script src="http://cdn.jsdelivr.net/webshim/1.12.4/polyfiller.js"></script> 
  <label style="font-size:20px;">期間</label> <form id="form1" runat="server" action="kasrapro.php"> <input type="text" id="txtDate" name= "sdate" /> 

Seems like it was a formatting error. 似乎是格式错误。 Still there is one error in console that is because of your polyfiller.js , but DatePicker is working now. console中仍然有一个错误是由于您的polyfiller.js ,但DatePicker现在正在工作。

 <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" type="text/css" media="all" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $('#txtDate').datepicker({ dateFormat: 'yy-mm-dd' }).val(); $('#txtDate').datepicker(); }); </script> <script src="https://cdn.jsdelivr.net/webshim/1.12.4/extras/modernizr-custom.js"></script> <!-- polyfiller file to detect and load polyfills --> <script src="https://cdn.jsdelivr.net/webshim/1.12.4/polyfiller.js"></script> <label style="font-size:20px;">期間</label> <form id="form1" runat="server" action="kasrapro.php"> <input type="text" id="txtDate" name="sdate" /> </form> 

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

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