How do I post or delete the specific data from the API? the most of the examples I have seen are either using PHP is there any to perform this using only ajax script
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
//console.log(this.response)
var arrayOfObjects = eval(this.response);
for (var i = 0; i < arrayOfObjects.length; i++) {
var object = arrayOfObjects[i];
document.getElementById("result").innerHTML += object.id + " " + object.name + " " + object.email + "<br/>";
}
}
};
xhttp.open("GET", "https://....mockapi.io/get", true);
xhttp.send();
<div id="demo"></div>
<div id="result"></div>