Bare af interesse hvad hardware bruger du?
Som a3-seo skriver, har du prøvet dette?
<button type="button" onclick="loadDoc1()">Lampe 1</button>
<button type="button" onclick="loadDoc2()">Lampe 2</button>
<button type="button" onclick="loadDoc2()">Lampe 3</button>
<p id="demo1"></p>
<script>
function loadDoc1() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo1").innerHTML = this.responseText;
}
};
xhttp.open("GET", "
http://192.168.10.79/cm?cmnd=Power1%20TOGGLE", true);
xhttp.send();
}
function loadDoc2() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo1").innerHTML = this.responseText;
}
};
xhttp.open("GET", "
http://192.168.10.79/cm?cmnd=Power2%20TOGGLE", true);
xhttp.send();
}
function loadDoc3() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo1").innerHTML = this.responseText;
}
};
xhttp.open("GET", "
http://192.168.10.79/cm?cmnd=Power3%20TOGGLE", true);
xhttp.send();
}
</script>