-->
Page 1 of 2

Live data in SPIFFS page

PostPosted: Sun Nov 20, 2016 10:52 am
by ian
I've seen quite a lot of requests re 'how to insert data into a static/SPIFFS page?'
Often the advice is to split the page & serve it in sections. You really don't have to do this.

There is a family of javascript utilities to do it for you. The important one being 'W3-include-html'
See: http://www.w3schools.com/howto/howto_html_include.asp

I use this a lot & it works fine. Just make sure that your server responds appropriately to the request.
Look closely at this and you'll find the answer: http://www.w3schools.com/lib/w3data.js
Embed the js in your page & you're sorted.

I can't give you code (I use this as a challenge for students) but I'm happy to show it working.

Cheers

Ian

Re: Live data in SPIFFS page

PostPosted: Sun Nov 20, 2016 10:55 am
by rudy
ian wrote:I've seen quite a lot of requests re 'how to insert data into a static/SPIFFS page?'
Often the advice is to split the page & serve it in sections. You really don't have to do this.


I didn't think so either. But I don't know enough to put together an example. But looking at the 2nd link you provided, I doubt I would want to figure all that out. (maybe)

Re: Live data in SPIFFS page

PostPosted: Thu Nov 24, 2016 11:48 am
by ian
I'm sorry, I was incredibly vague in my post. I've typed up a better explanation:
http://myiot.co.uk/data_in_SPIFFS/

Ian

Re: Live data in SPIFFS page

PostPosted: Thu Nov 24, 2016 12:37 pm
by rudy
Thanks. That helps a lot.