Buongiorno a tutti!
Per il lavoro che sto facendo mi occorre una funzione JS che inoltri una richiesta ad una url e ricevuta la risposta la mostri. In particolare la risposta ricevuta è un puro documento html. Ora, ho implementato la richiesta, ma non riesco a fare in modo che la risposta venga mostrata
codice:
function checkDelete(user) {
if(confirm('Are you sure to want to delete your account?')) {
var url = "http://localhost:5555/LAIAnnounces/WebServlet?op=delete&user=" + user;
xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", url, true);
xmlHttp.send();
document.write(xmlHttp.responseText);
}
}
e il documento che ricevo è questo
codice:
<html>
<head>
<meta content="0; url=web/jsp/dsuccess.jsp" http-equiv="refresh" />
</head>
<body>
</body>
</html>
Mi direste gentilmente dove sbaglio?