I am making the following code:
if(xhr.status == 200){
console.log(xhr.responseText);
window.location.reload();
}
But when I do this, it seems like it goes into an eternal loop and crashes my server. How do I make it refresh the page only once and stop?