Submit To Arduino Relay Wtihout Page Refresh

Written By engineerisaac

Posted: Sat, Jun 20, 2020 at 4:28 PM - Showing 26 Views


The HTML Markup



Wait
Turn On
Turn Off



Javascript Markup



function relay(ip,relay,state,output) {

var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById(output).innerHTML = this.responseText;
console.log(this.responseText);
}
};
xhttp.open("GET", "tools/send_relay.php?ip="+ ip +"&relay=" + relay + "&state="+ state, true);
xhttp.send();


}



PHP Code:
[code]

Comments:
Nobody
This Isnt Finished yet.
Leave a Comment: