I have a php calendar script that moves through the months using get vatiables e.g.
if(isset($_GET['chm'])) :
$m = ($_GET['prm'])+($_GET['chm']);
else:
$m = date("m");
$y = date("Y"); // Find today's year
endif;
$d= date("d"); // Find today's date
$y= date("Y"); // Find today's year
$no_of_days = date('t',mktime(0,0,0,$m,1,$y)); // This is to calculate number of days in a month
$mn=date('F',mktime(0,0,0,$m,1,$y)); // Month is calculated to display at the top of the calendar
$yn=date('Y',mktime(0,0,0,$m,1,$y)); // Year is calculated to display at the top of the calendar
$j= date('w',mktime(0,0,0,$m,1,$y)); // This will calculate the week day of the first day of the month
The calendar is displayed on the index page, what is the best way to use a JQuery Ajax request to update the calendat without a page refersh?
Is it to put the actual calendar on a separate page and call something like this?
var prm = $("#prm");
var chm = $("#chm");
$.ajax({type: "GET", url: "calendar.php", data: "&prm=" + prm + "&chm=" + chm,
complete: function(data){
calendardiv.html(data.responseText);
}
});
Help / comments appreciated thanks in adavance