$.ajax({
url: "https://app.asana.com/-/api/0.1/workspaces/",
type: 'GET',
dataType: 'json', // added data type
success: function(res) {
console.log(res);
alert(res);
}
});
$.ajax({
url: "www.site.com/page",
success: function(data){
$('#data').text(data);
},
error: function(){
alert("There was an error.");
}
});
$(document).ready(function(){
var a ="demo_test.asp";
$("button").click(function(){
$.get("demo_test.asp", function(a){
alert(a);
});
});
});
$.get("demo_test.asp", function(data){ //change demo_test.asp to your server route
alert("Data: " + data);
});
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
document.getElementById("demo").innerHTML = this.responseText;
}
xhttp.open("GET", URL);
xhttp.send();