2014-05-23 71 views
0

當我將datepicker組件和fullcalendar組件包含到佈局文件中時, datepicker不在使用。但是,每個頁面都可以一個接一個地正常工作。 plae幫助我。 代碼在這裏: Calendar.jspjQuery datepicker和fullcalendar,datepicker沒有顯示

<html> 
<head> 
<title>calendar</title> 
<link rel='stylesheet' type='text/css' href='http://arshaw.com/css/main.css?6' /> 
<link rel='stylesheet' type='text/css' href='http://arshaw.com/css/fullcalendar.css?3' /> 
<link rel='stylesheet' type='text/css' href="fullcalendar.css" /> 
<script type='text/javascript' src='http://arshaw.com/js/fullcalendar-1.6.3/jquery/jquery-1.10.2.min.js'></script> 
<script type='text/javascript' src='http://arshaw.com/js/fullcalendar-1.6.3/jquery/jquery-ui-1.10.3.custom.min.js'></script> 
<script type='text/javascript' src='http://arshaw.com/js/fullcalendar-1.6.3/fullcalendar/fullcalendar.min.js'></script> 
<script> 
$(function() { 

     $('#calendar').fullCalendar({ 
            // 
        }); 
</script> 

日期選擇器

<script type='text/javascript'> 
$(function() { 

    $("#datepicker").datepicker(); 

    $("#datepicker").datepicker("option", "dateFormat","yy-mm-dd"); 

    $.datepicker.regional['ko'] = { 
       ... 
      }; 
       $.datepicker.setDefaults($.datepicker.regional['ko']); 
}); 
</script> 

layout.jsp

<html> 
<head> 
<title>Insert title here</title> 
</head> 
<body> 
<table border="1"> 
<!-- datepicker input text part --> 
<tr height="300px"><td><%@ include file = "./datepicker.jsp" %></td></tr> 

<!-- Jquery fullcalendar part --> 
<tr><td><%@ include file = "./Calendar.jsp" %></td></tr> 
</table> 
</body> 
</html> 
+0

我無法看到你的代碼,你能請再試一次? – ochi

+0

我貼吧。你能看見它嗎? –

+0

我覺得問題是JavaScript的功能...我已經使用onload函數$(文檔).ready(函數()但仍然不能正常工作 –

回答

0

您似乎包括JS文件在您的Calendar.jsp中,但在Layout.jsp中找到datepicker,因此當加載Calendar.jsp時,它不知道datepicker的位置。

嘗試將所有的包括JS和CSS文件到您的Layout.jsp

我把這個小提琴一起,似乎工作:

http://jsfiddle.net/2faxr/