Code
<script>
function myFunction(id) {
if ( confirm ('Wollen Sie die Tabelle als storniert buchen ?') )
{
var xhReq = new XMLHttpRequest();
xhReq.open( "POST", "ajax2.php?editId="+id, true );
xhReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhReq.send("cmd=shutdown");
window.location.href = "index.html";
return true;
//var serverResponse = xhReq.responseText;
//alert(serverResponse); // Shows the return from the PHP script
} else {
event.preventDefault();
}
}
</script>
Alles anzeigen
Hallo, es wird eine Funktion ausgeführt, welche bis auf die Weiterleitung funktioniert.
Seht ihr das Problem an der Funktion?