fetch('https://api.covid19api.com/summary')
.then(response => response.json())
.then(data => console.log(data))
.catch(err => {
console.log(err)
});
var id = empid;
$.ajax({
type: "POST",
url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders",
data: "{empid: " + empid + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result){
alert(result.d);
console.log(result);
}
});
function ajaxGetRequest(path, callback){
let request = new XMLHttpRequest();
request.onreadystatechange = function(){
if (this.readyState === 4 && this.status === 200){
callback(this.response);
}
};
request.open("GET", path);
request.send();
}
function ajaxPostRequest(path, data, callback){
let request = new XMLHttpRequest();
request.onreadystatechange = function(){
if (this.readyState === 4 && this.status === 200){
callback(this.response);
}
};
request.open("POST", path);
request.send(data);
}
var xhr = new XMLHTTPRequest();