How can the issue of loading the entire page instead of just the Div content be resolved when updating a Div container in PHP?

Issue: When updating a Div container in PHP, the entire page is being reloaded instead of just the Div content. This can be resolved by using AJAX to asynchronously update the Div container without reloading the entire page.

<div id="container">
  <!-- Content to be updated -->
</div>

<script>
  function updateDivContent() {
    $.ajax({
      url: 'update_div_content.php',
      type: 'GET',
      success: function(data) {
        $('#container').html(data);
      }
    });
  }

  // Call the function to update the Div content
  updateDivContent();
</script>