integrate a css or js file inside HTML with ESP in AP

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
giants
Posts: 44
Joined: Fri Apr 26, 2019 2:07 pm

integrate a css or js file inside HTML with ESP in AP

Post by giants » Sun May 22, 2022 5:31 pm

Hi there !
here i'm for ask again your help. I'm gonna to work a one project for my self and mabye for a couple of friends. I use one ESP32 when run the first time start in AP and show to me from a web page all router him found, and that work . My problem is that i create my webpage and i save inside the ESP and i use f=open(nameMyFile.html) . Now i create my css file and i save inside a ESP so how i can say at my html file import css file ?

Thank a lot

Sergio

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: integrate a css or js file inside HTML with ESP in AP

Post by karfas » Mon May 23, 2022 11:20 am

See any HTML introduction how to reference a CSS from a HTML file.
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

giants
Posts: 44
Joined: Fri Apr 26, 2019 2:07 pm

Re: integrate a css or js file inside HTML with ESP in AP

Post by giants » Mon May 23, 2022 1:14 pm

I did, but the problem is the file is inside ESP32 and use script or link dosen't work. I think i need the give a path but i don't have idea how to do

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: integrate a css or js file inside HTML with ESP in AP

Post by karfas » Mon May 23, 2022 4:04 pm

giants wrote:
Mon May 23, 2022 1:14 pm
I did, but the problem is the file is inside ESP32 and use script or link dosen't work. I think i need the give a path but i don't have idea how to do
A "file" is nothing else than any other file served by a webserver. "It does not work" doesn't count as analysis of your problem.
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

Post Reply