Hi,
I'm porting one of my sketches from Uno to Yun that sends an HTML page to a browser, which includes javascript code.
My code to serve the page looks something like this (HTML is more complex, but this is just for illustration):
YunClient client = server.accept();
client.println("<!DOCTYPE html>");
client.println("<html>");
client.println("<head>");
client.println("<title>Arduino Web Page</title>");
client.println("</head>");
client.println("<body>");
client.println("<h1>Arduino AJAX Sensor Monitor</h1>");
client.println("<p>Tmp102: <span id=\"tmp102_txt\">Unread</span>°C</p>");
client.println("<p>HH10D: <span id=\"hh10d_txt\">Unread</span>%</p>");
client.println("<p>MPL3115A1 Pressure: <span id=\"MPL3115A1Pres_txt\">Unread</span> Pa</p>");
client.println("<p>MPL3115A1 Temp: <span id=\"MPL3115A1Temp_txt\">Unread</span>°C</p>");
client.println("</body>");
client.println("</html>");
This is sent to the web browser, but the text is being put inside a
HTML tag. That makes sense when you're first experimenting with this functionality, but is there anyway to disable this mechanism, so I can just send the raw HTML?I understand that it's possible to get linux side to serve the webpage, but I'd like to do it this way in order to teach my students basic concepts.
Thanks,
-Rob Purser