jQuery在选项卡中使用datepicker

时间:2015-03-13 20:29:19

标签: jquery tabs datepicker

我有一个带标签的主页面 main.php

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
<script src="../lib/datepicker-it.js"></script>
</head>
<script>
$(function() {
    $( "#tabs" ).tabs();
}); 
</script>
<body>

<div id="tabs">
<ul>
<li><a href="page1.php">Page1</a></li>
<li><a href="page2.php">Page2</a></li>
</ul>
</div>
</fieldset>
</body>
</html>

page1.php和page2.php在开头包含以下代码,以便在输入中使用classes =&#34; datepicker&#34;

显示日期选择器
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">   </script>
<script>    
$(function() {
    $.datepicker.setDefaults( $.datepicker.regional[ "it" ] );
    $( ".datepicker" ).datepicker({
        changeMonth: true,
        changeYear: true,
        dateFormat: "dd/mm/yy",
        showOtherMonths: true,
        selectOtherMonths: true
    });
});

但是在加载标签后我收到此错误并且日期datepicker不起作用

Uncaught TypeError: undefined is not a function

0 个答案:

没有答案