kopia lustrzana https://github.com/alanesq/esp32cam-demo
Add files via upload
rodzic
499691d1d9
commit
de5422cbe5
|
@ -1,7 +1,7 @@
|
|||
// ----------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
// ESP32 / ESp8266 very basic web server demo - 10Jan21
|
||||
// ESP32 / ESp8266 very basic web server demo - 11Jan21
|
||||
//
|
||||
// shows use of AJAX to show updating info on the web page
|
||||
//
|
||||
|
@ -224,7 +224,7 @@ void handleAJAX() {
|
|||
Serial.println("Ajax page requested from: " + String(cip[0]) +"." + String(cip[1]) + "." + String(cip[2]) + "." + String(cip[3]) );
|
||||
|
||||
|
||||
// ------------------- send the html -------------------
|
||||
// ---------------------- html ----------------------
|
||||
|
||||
client.print (R"=====(
|
||||
|
||||
|
@ -250,9 +250,7 @@ void handleAJAX() {
|
|||
|
||||
// ------------------- JavaScript -------------------
|
||||
|
||||
client.print (R"=====(
|
||||
|
||||
<script>
|
||||
client.print (R"=====(<script>
|
||||
|
||||
function sendData(led) {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
|
@ -280,10 +278,7 @@ void handleAJAX() {
|
|||
getData();
|
||||
}, 2000);
|
||||
|
||||
</script>
|
||||
|
||||
)=====");
|
||||
|
||||
</script>)=====");
|
||||
// --------------------------------------------------
|
||||
|
||||
// close html page
|
||||
|
@ -295,7 +290,7 @@ void handleAJAX() {
|
|||
|
||||
|
||||
// send data to AJAX web page
|
||||
// it replies with two items comma seperated: the value in millis and some text
|
||||
// it replies with two items comma separated: the value in millis and some text
|
||||
void handleSendData() {
|
||||
String reply = String(millis()); // item 1
|
||||
reply += ",";
|
||||
|
|
Ładowanie…
Reference in New Issue