added some javascript to webserver\nsome debugging
This commit is contained in:
29
webserver/javascript.php
Normal file
29
webserver/javascript.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
function insertJavascript()
|
||||
{
|
||||
global $listenPort;
|
||||
return '<script language="javascript">
|
||||
<!--
|
||||
function setPropertyValue(topic, fn, value, property)
|
||||
{
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "http://192.168.1.253:' . $listenPort . '/set&fn="+fn+"&property="+property+"&topic="+topic+"&value="+value);
|
||||
xhr.onload = function () {};
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
function getPropertyValue(topic, fn, property)
|
||||
{
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "http://192.168.1.253:' . $listenPort . '/get&fn="+fn+"&property="+property+"&topic="+topic );
|
||||
xhr.onload = function () {};
|
||||
xhr.send();
|
||||
setTimeout(function()
|
||||
{
|
||||
location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
// -->
|
||||
</script>';
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user