I have a custom API im building and when I send an AJAX get request it hits my API over and over. I understand a POST request is needed to update records. Im just troubleshooting with get for now as the problem is within JS. Why does JS keep hitting my API after the click? I only need one request. Fetch does the same thing.
saveEditButton.addEventListener("click", function(){
const Http = new XMLHttpRequest();
const url='APIURL';
Http.open("GET", url);
Http.send();
});
I tried fetch along with setting the main function to async.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/vi8OAwB
Comments
Post a Comment