implemented action get_zone_info

This commit is contained in:
schrom01
2022-08-24 21:20:54 +02:00
parent 2747b79f37
commit 442a7a8b11
3 changed files with 94 additions and 0 deletions
+67
View File
@@ -0,0 +1,67 @@
function sleep (time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
function send_web_request($url, $messagestring, $varstring) {
// Browserkompatibles Request-Objekt erzeugen:
r = null;
if(window.XMLHttpRequest)
{
r = new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
try
{
r = new ActiveXObject('Msxml2.XMLHTTP');
}
catch(e1)
{
try
{
r = new ActiveXObject('Microsoft.XMLHTTP');
}
catch(e2)
{
alert("Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.");
}
}
}
// Wenn Request-Objekt vorhanden, dann Anfrage senden:
if(r != null)
{
// HTTP-POST
r.open('POST', $url, true);
r.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
r.send($varstring);
if($messagestring != 'no')
{
alert($messagestring);
}
sleep(500).then(() => {
//window.location.href = window.location.href;
//document.location.reload();
});
}
else
{
alert("Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.");
}
}