$.ajax({ url: "www.site.com/page", success: function(data){ $('#data').text(data); }, error: function(){ alert("There was an error."); } });
const xhttp = new XMLHttpRequest(); xhttp.onload = function() { document.getElementById("demo").innerHTML = this.responseText; } xhttp.open("GET", URL); xhttp.send();