I am new in ajax wordpress,I have shown the post with ajax,but now i have problem i want to show the previous post with ajax,means i have shown the posts with ajax and when user click on the one post and it displays and when click on the browser backbutton then previous posts does not show.Can any one tell me how to show the previous wordpress ajax post with browser backbutton. Here is the code i have used
<script type="text/javascript">
jQuery(document).ready(function($) {
jQuery(".ajaxclick").click(function() {
var post_id1 = $(this).parent("li").attr("id");
var pageurl = $(this).attr('href');
alert(pageurl);
var ajaxURL = '<?php echo get_admin_url(); ?>admin-ajax.php';
$.ajax({
url: ajaxURL,
type: 'POST',
beforeSend: function() {
$("#loading-animation").hide();
$("#ajaxloader").show();
},
complete: function() {
$("#loading-animation").show();
$("#ajaxloader").hide();
},
data: {
action: 'load-content',
post_id: post_id1
},
success: function(response) {
jQuery("#loading-animation").addClass('loadingstyle');
jQuery("#loading-animation").html(response);
return false;
}
});
});
});
</script>