我現在用的是笨的框架,並試圖使用jquery用於顯示和允許用戶選擇,他希望他的瓶坯搜索的時間週期爲目的的日曆。我有日期和文本字段顯示,但是當我點擊文本字段時,我沒有任何日曆從中選擇日期。 這是我的看法:試圖顯示使用jQuery UI的
<html>
<head>
<script type="text/javascript" src="<?php echo $jquery?>"></script>
<script type="text/javascript">
$(function() {
$("#datepicker").ui-datepicker();
});
</script>
</head>
<body>
<div class="demo">
<p>Date: <input id="datepicker" type="text"></p>
</div><!-- End demo -->
<div style="display: none;" class="demo-description">
<p>The datepicker is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay. Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.</p>
</div><!-- End demo-description -->
<a href="">www.msn.ca</a>
<?php echo form_open('search/submit'); ?>
</body>
</html>
它取自示例代碼:http://jqueryui.com/demos/datepicker/ 僅供參考我使用jQuery UI 16年8月1日 不知道什麼是錯在這裏。 如果有人認爲該控制器是相關的,然後在這裏它是:
<?php
class calendarController extends CI_Controller{
public function index()
{
$this->load->helper('url');
$data['jquery'] = base_url("jquery.js");
$this->load->view("jqueryView", $data);
}
}
?>
我應該將它們添加到身體或頭? –
jQuery UI當然取決於jQuery,所以jquery-1.7.min.js應該在jquery-ui-1.8.16之上,對此很抱歉。 – AFD
這很好。我知道了。謝謝:) –