簡體   English   中英

日期選擇器js不起作用?

[英]date picker js didn't work?

我想將日期選擇器與js一起使用,因此它可以在某些頁面中與該頁面相同的代碼工作,但在此頁面中卻無法使用。 我希望有人可以幫助我

這是我的代碼:

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

似乎是格式錯誤。 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