Chat freely about anything...

User avatar
By jankop
#75463 In your program and in the answer of your server, I see special constructions <body /> and <br />. Can you tell me what that means?

Code: Select all<!DOCTYPE HTML>
<html>

<body>

<head><title><h3>Weather Observations<h3></title></head>
<h2>Treyburn Lakes<br />
Indianapolis, IN 46239</h2><br />
Last Update: 
04/18/2018 , 12:00:00
 EST <br />
Humidity: 
35.2 %<br />Dew point: 
34.6 F. <br />Temperature: 
62.8 F.<br />Heat Index: 
65.12 F. <br />Barometric Pressure: 
29.734 in. Hg.<br />-0.004
 in. Hg --Difference since last update <br />Barometric Pressure: 
1006.9
 mb.<br />
Atmosphere: 
0.96 Atm <br />Altitude: 
824 Feet<br /><h2>Weather Observations</h2>
<h3>04/18/2018 , 12:12:37  EST </h3>

<a href=http://69.245.183.113:8002/LOG.TXT download>Current Week Observations</a><br />
<br />

<a href=http://69.245.183.113:8002/SdBrowse >Collected Observations</a><br />
<br />

<a href=http://69.245.183.113:8002/Graphs >Graphed Weather Observations</a><br />
<br />

<a href=http://69.245.183.113:8002/README.TXT download>Server:  README</a><br />
<br />

<body />

<br />

</html>


Code: Select allFound 0 errors 9 warnings
line 6 column 1 - Warning: <head> isn't allowed in <body> elements
line 6 column 7 - Warning: <title> isn't allowed in <body> elements
line 6 column 7 - Warning: missing </title> before <h3>
line 6 column 14 - Warning: replacing unexpected h3 by </h3>
line 6 column 42 - Warning: discarding unexpected </title>
line 6 column 50 - Warning: </head> isn't allowed in <body> elements
line 38 column 1 - Warning: <body> isn't allowed in <body> elements
line 26 column 1 - Warning: <a> proprietary attribute "download"
line 35 column 1 - Warning: <a> proprietary attribute "download"
User avatar
By Sirquil
#75467 [quote="jankop"]In your program and in the answer of your server, I see special constructions <body /> and <br />. Can you tell me what that means?

Everything between "< >" such as; "<body /> and <br /> are part of the HTML markup language for displaying a web page. https://tinyurl.com/Robotdynwifi is the web page generated by this code each time there is a GET request from your web browser; such as, going to the link I just posted.. This project is my first HTML experience; if there are correction/s needed, I am willing to make corrections.

You can see more about HTML here: https://www.w3schools.com/html/default.asp

Where are you seeing the warning messages; this is the first I have heard of the warnings, in over 16K views of this topic. What web browser are you using for the Internet?

"Fast_Time_Web_Interface_v5.ino" is the latest version; compiled with "Arduino IDE" 1.8.5, Selected: "Wemos D1 R2 & mini" for the Board, used Version 2.4.1 of esp8266 from the "Arduino IDE, Board Manager." .
User avatar
By schufti
#75468 might be the cause why I still cannot see the direct webpage from the esp ... ?
to me it looks like a misinterpretation of https://www.w3schools.com/html/html_elements.asp
Empty HTML Elements

HTML elements with no content are called empty elements.

<br> is an empty element without a closing tag (the <br> tag defines a line break).

Empty elements can be "closed" in the opening tag like this: <br />.

HTML5 does not require empty elements to be closed. But if you want stricter validation, or if you need to make your document readable by XML parsers, you must close all HTML elements properly.


the <br /> won't matter as they are considered empty, but
a) the opening <body> is never closed (maybe not relevant in HTML5)
b) another (empty) body <body /> within the former unclosed one might upset some browsers ...

and final: the <head> ... </head> is supposed to be between <html> and <body> acording to t
https://www.w3schools.com/html/html_head.asp

so, the html check seems right about complaining non standard html ...
User avatar
By Sirquil
#75472 Edited HTML lines:
Code: Select all// Now send the response data.
               // output dynamic webpage
               client.println("<!DOCTYPE HTML>");
               client.println("<html>\r\n");
               client.println("<head><h3><title>Weather Observations</title><h3>");
               // add a meta refresh tag, so the browser pulls again every 15 seconds:
               //client.println("<meta http-equiv=\"refresh\" content=\"15\">");
               client.println("<h2>Treyburn Lakes<br />");
               client.println("Indianapolis, IN 46239</h2></head><br />");
               client.println("<body>\r\n");
                                        ...... lines continue dynamic output untill
                                        client.println("<body />\r\n");
               client.println("</html>\r\n");


Thank you jankop and schufti!

William
Attachments
Corrected HTML, Reformatted listen function; corrected if "GET" else invalid method.
(11.01 KiB) Downloaded 218 times