I have a php calendar where i use next and prev link to go through next month or previous month. I want it to load calendar data without page refresh and i'm unable to figure it.
my next link produce like :
http://localhost/blog3/blog?month=03&year=2017 and
prev link like:
http://localhost/blog3/blog?month=01&year=2017
and here my calendar is not included from other page. also my if i click next or prev its load entire page in calendar div.
[jquery]
$('#cprev').on('click', function(e){
e.preventDefault();
var pmonth = Pmonth;
var pyear = Pyear;
var url = 'http://localhost/blog3/blog?month='+pmonth+'&year='+pyear;
$.ajax({
type:"POST",
url: url,
data: {pmonth:"pmonth",pyear:"pyear"},
success: function(result){
$('.calendar').html(result);
},
error: function(){
}
});
return false;
});
in my main page
<script>
var Pmonth = <?php echo($prev_month); ?>;
var Pyear = <?php echo($prev_year); ?>;
var Nmonth = <?php echo($next_month); ?>;
var Nyear = <?php echo($next_year); ?>;
</script>