I'm not sure what the best way to handle this is but here is what I'm trying to do. After a user deletes a photo I need to update my two divs with new stats and a new table. This is done initially by calling two functions. Can I call these PHP functions with jquery somehow or is there a better way?
Here is what my current code snippet looks like:
<?php
include('header.php');
?>
<script type="text/javascript">
$(document).ready(function() {
$('.image_result li').click(function() {
var imgInfo = $(this).attr('id').split(':');
if(confirm('Are you sure you want to delete this image?')) {
$.post('delete_image.php?image_id=' + imgInfo[0] + '&user_id=' + imgInfo[1], function(data) {
// How can I update both divs (imageStats, and imageTable) by calling my two PHP functions?
});
}
});
});
</script>
<div id="imageStats" ><?php echo get_image_stats(); ?></div>
<div id="imageTable" ><?php get_user_images(); ?></div>