2
我在用下面的代碼的煩惱:
<link type="text/css" href="http://jqueryui.com/latest/themes/base/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.4.2.js"></script>
<script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/tags/1.8rc1/jquery-1.4.1.js"></script>
<script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/tags/1.8rc1/ui/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#datepicker").datepicker({ gotoCurrent: false,
onSelect: function(date, inst) { window.location = "diary.php?date="+date; },
dateFormat: 'dd-mm-yy',
defaultDate: <?php if(isset($_GET['date'])) { echo $_GET['date']; } else { echo "null"; } ?>
});
});
</script>
出於某種原因,當我選擇一個日期和切換頁面 - 它不不要去$_GET['date']
參數中的defaultDate
。相反,它會跳轉到一些隨機頁面。 defaultDate
描述表示它將接受代碼中設置的相同格式的字符串。
在此先感謝您的幫助。
喜@Danny - 這將會是一個很好的姿態,以@Pekka如果你選中「接受」複選框,以紀念他的回答是,你需要什麼樣的解決你的問題。 – Pointy 2010-03-08 22:31:53