,你需要这样的代码: HTML:
<div id='next' class='year'></div>
<div id='next' class='month'></div>
<div id='prev' class='day'></div>
<div id='date'></div>
<div id='next' class='day'></div>
<div id='next' class='month'></div>
<div id='next' class='year'></div>
的jQuery:
$('.day, .month, .year').click(function() {
var a = $(this).attr('id'); // find prev or next clicked
var b = $(this).attr('class'); // find day or month or year clicked
$.ajax({
type: 'post',
url: //your php url,
data: {act: a, which: b, /* your other data */},
cache: false,
success: function(c) {
$('#date').html(c);
}
}):
});
和PHP:
<?php
include //your class
echo $calendar->show('$_POST['data']')
?>
来源
2015-06-19 17:02:10
ATR
包括更多的代码:HTML/JS/PHP – CodeGodie
你会如果您想在不重新加载页面的情况下获取某些数据,则需要发出ajax请求。 – aakashbhowmick