var dates = [new Date(2014, 02 - 1, 19),
new Date(2014, 02 - 1, 20),
new Date(2014, 02 - 1, 21),
new Date(2014, 01 - 1, 21)
];
與我的數據輸入,但我有我的數據從數據庫,自動寫入。 我不太瞭解jQuery,我是初學者。jQuery with Ajax,mysql,從邏輯數據提取
我想要做什麼:數據庫作爲變量的數據定義
HTML代碼:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="iso-8859-9">
<title>jQuery UI Datepicker - Türkçe Takvim Textbox'u...</title>
<link rel="stylesheet" href="css/jquery.ui.all.css">
<link rel="stylesheet" href="css/demos.css">
<script src="js/jquery-1.7.1.js"></script>
<script src="js/jquery.ui.core.js"></script>
<script src="js/jquery.ui.widget.js"></script>
<script src="js/jquery.ui.datepicker.js"></script>
<script src="js/jquery.ui.datepicker-tr.js"></script>
<style type="text/css">
#highlight, .highlight {
/*background-color: #000000;*/
}
.highlight > a.ui-state-default {
background: url("images/ui-bg_highlight-soft_25_ffef8f_1x100.png") repeat-x scroll 50% top #FFEF8F !important;
border: 1px solid #F9DD34;
color: #363636;
}
</style>
<script type="text/javascript">
var dates = [new Date(2014, 02 - 1, 19),
new Date(2014, 02 - 1, 20),
new Date(2014, 02 - 1, 21),
new Date(2014, 01 - 1, 21)
];
$(function() {
$('#datepicker').datepicker({
numberOfMonths: [1, 1],
beforeShowDay: highlightDays
}).click(function() {
$('.ui-datepicker-today a', $(this).next()).removeClass('ui-state-highlight ui-state-hover');
//$('.highlight a', $(this).next()).addClass('ui-state-highlight');
});
$('#datepicker').click(function() {
// put your selected date into the data object
var data = $('#datepicker').val();
/*
$.get('getdata.php?date=' + data, function(data) {
$('#events').html(data).show('slow');
});*/
});
function highlightDays(date) {
for (var i = 0; i < dates.length; i++) {
if (dates[i].getTime() == date.getTime()) {
return [true, 'highlight'];
}
}
return [true, ''];
}
});
</script>
</head>
<body>
<div id="datepicker"></div>
</body>
</html>
你能更準確的瞭解您的問題 – dreamweiver