If you want to host it locally, it would make sense to implement it as an HTML Application.
QuoteIf you want to host it locally, it would make sense to implement it as an HTML Application.How else would your arduino provide data for your JSON/AJAX web page other than thru serving up the data via the http process? I've seen arduino code for telnet and udp but that would seem to be very complicated and unpractical in a web setup. One can make whiz-bang (and totally annoying) web pages using files/images stored on a big web server, but this really does not have anything to do with the arduino itself serving basic data to be displayed within the page.
Implementing this as an AJAX application that gets data from the Arduino simply gives you a better solution than serving your whole page from the Arduino.
The Arduino isn't a good platform for serving out rich HTML documents, style sheets, scripts and all that.
As I understand it, you have a local web page that provides all the decorative stuff and just executes an HTTP request to the Arduino to retrieve some data. The page then processes the results and uses that to populate the page. The basic approach seems OK. I haven't look at the detail of your JSON handling, but your JSON fragment is incorrect: the field names should not be quoted.I suggest you get that sorted out by hard-coding your JSON string in the page and then use your existing logic to exec it into a variable; then you can print out whatever fields of that variable interest you.