How do you reference JS and CSS files in the playground? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
- 1

How do you reference JS and CSS files in the playground?

I'm trying to add JS code to my webpage in the playground but only works if I use script Tag. I want to put My code apart from the HTML but playground does not read it.

21st Nov 2022, 4:04 AM
Ximeno el Fuerte
Ximeno el Fuerte - avatar
3 Respuestas
+ 5
Sololearn's Web interface in the code playground has 3 tabs for entering in HTML, CSS and JavaScript respectively. So you don't need to link them here. You might see that people do include the link in the head section but comment it out. That's the best of both worlds.
21st Nov 2022, 9:12 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
your js have to be hosted somewhere accessible. I don't think Sololearn can read local files.
21st Nov 2022, 11:39 AM
Bob_Li
Bob_Li - avatar
0
Well That's What You usually do, but here in Sololearn playground seems to be diferent. I don't see links in people's HTML code. They just write HTML, CSS and JS separately with no links and works fine. No My case.
21st Nov 2022, 4:45 AM
Ximeno el Fuerte
Ximeno el Fuerte - avatar