I would like to refresh the #calendar
div with the new content sent to calendar.php
I'm getting a success alert, but the content isn't refreshing. How do I get the new calendar.php to show up with the POSTed data?
$(document).ready(function(){
$('#next').click(function() {
$.ajax({
type: "POST",
url: "calendar.php",
data: 'year=2012',
target: '#calendar',
success: function(html){
alert("Success");
}
});
});
The relevant HTML code is here:
#next
is the id on a div tag in calendar.php
<div id="calendar">
<?php include('calendar.php'); ?>
</div><!-- /#calendar -->