What is the difference between using an anchor and JavaScript+Ajax for page reloading?

Using an anchor for page reloading involves linking to a specific section of the page, causing it to scroll to that section. On the other hand, using JavaScript+Ajax for page reloading allows for dynamic content updates without a full page refresh.

// Example of using JavaScript+Ajax for page reloading
<script>
function reloadPage() {
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {
            document.getElementById("content").innerHTML = this.responseText;
        }
    };
    xmlhttp.open("GET", "updated_content.php", true);
    xmlhttp.send();
}
</script>

<button onclick="reloadPage()">Reload Page</button>
<div id="content"></div>