Files
OpenBK7231T_App/src/httpserver/script_ha_discovery.js
2022-10-16 07:29:59 -05:00

22 lines
526 B
JavaScript

//The content of this file get set into ha_discovery_script (new_http.cs)
function send_ha_disc() {
var xhr = new XMLHttpRequest();
xhr.open(
"GET",
"/ha_discovery?prefix=" + document.getElementById("ha_disc_topic").value,
false
);
xhr.onload = function () {
if (xhr.status === 200) {
alert(xhr.responseText);
} else if (xhr.status === 404) {
alert("Error invoking ha_discovery");
}
};
xhr.onerror = function () {
alert("Error invoking ha_discovery");
};
xhr.send();
}