From a57424aa889c4bd4cf63bdd6987d23af75c42f11 Mon Sep 17 00:00:00 2001 From: Alan <60433566+alanesq@users.noreply.github.com> Date: Sun, 10 Jan 2021 17:37:25 +0000 Subject: [PATCH] Add files via upload --- Misc/VeryBasicWebserver.ino | 53 +++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/Misc/VeryBasicWebserver.ino b/Misc/VeryBasicWebserver.ino index 84f3cb3..996e9a9 100644 --- a/Misc/VeryBasicWebserver.ino +++ b/Misc/VeryBasicWebserver.ino @@ -13,18 +13,17 @@ // Wifi Settings +#include // delete this line, un-comment the below two lines and enter your wifi details -const char *SSID = "your_wifi_ssid"; +//const char *SSID = "your_wifi_ssid"; -const char *PWD = "your_wifi_pwd"; +//const char *PWD = "your_wifi_pwd"; // --------------------------------------------------------------------------------------------------------- - - bool serialDebug = 1; // enable debugging info on serial port @@ -220,33 +219,40 @@ void handleButton(){ // HTML header const char HTML_Header[] = R"=====( - - - - AJAX Demo - - + + + + + AJAX Demo + + )====="; + // HTML Body const char HTML_Body[] = R"=====( -
+ + +

Update web page using AJAX


-
-
+
+
Current Millis : 0
Received text : NA
LED State is : NA
-
- )====="; +
+ + )====="; - // Javascript - // functions: sendData - triggered when a html button is pressed - // getData - refreshes data on page - received as a comma deliminated list - triggers every 2 seconds - const char HTML_JavaScript[] = R"=====( - - )====="; + + + )====="; void handleAJAX() { @@ -286,7 +293,7 @@ void handleAJAX() { client.print(HTML_Body); client.print(HTML_JavaScript); - client.print("\n"); // close HTML + client.print("\n"); // close HTML delay(3); client.stop();