Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By penatenjoe
#59315 That was a really good idea which did help me a lot. I ran across one issue:
I started by creating a html file on my PC to be uploaded later to the ESP8266 with some shorter html code snippets to be included. Later these snippets would contain the life data. What I found, though, is that when testing the file on the PC the include did not work. Not sure why, I could not see anything on the console of my browser.
Then I found a similar approach in https://github.com/LexmarkWeb/csi.js which worked for me right away. Just copy the short file csi.min.js into the same directory on the PC and later together with the html file into the SPIFFS filesystem. Makes creating webpages on the ESP8266 a lot easier!
PS: Chrome does not load the local page for security reasons.
User avatar
By ian
#59411 @penatenjoe
I don't really understand why it doesn't work for you :(
What do you mean, 'the include did not work' ?
I guess your server is ok handling files in SPIFFS?
I'll take a look at your link when I have time... Always nice to have options :)
The code I use works on Chrome too btw - I didn't write it - my javascript expertise falls well short :(

Cheers
Ian
User avatar
By penatenjoe
#59468 @Ian
My idea was to develop the web page locally with a normal editor and then download it to the ESP into SPIFFS only once I was done.
I put the main file into a folder on my PC as well as the includes. The includes were small files just for testing purposes. I opened the file with a normal browser. The contents of the main file was showing properly, the include (still being local files) did not load when using the w3school script - but did so when using the script from github. I did not compare or analyze the scripts, though and it may have been an error on my part.
You may try opening a html file located on your PC (!) containing javascript with Chrome. When I did that I saw a security error in the chrome console and the include files were not loaded. There are command line options for Chrome which enable local javascript execution. I shared this since it took me a little while to figure it and someone else may try something similar.