JS is not working in my deployed page. Any ideas why? #112219
-
|
I just uploaded a Frontend-mentor project. I am using the git-pages tool to host my website. The HTML and CSS work fine, but I seem to have a problem with my JS, since my mobile Navigation is not working. Does somebody got an idea, what went wrong? Repository: https://github.com/LucasRegalar/Responsive-Landing-Page Thank you so much in advance! Love |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
I believe I found the problem. I used "vite" to create all my files and by default they add the JS link with a type of "module" which doesn't work in browsers, but in live-servers. I already changed my index.html accordingly: <script src="main.js"></script>and commited the new version. Now I only got the problem, that the pages-hosting algorithm still uses my old index.html file. Maybe somebody got an idea how I can change that? |
Beta Was this translation helpful? Give feedback.
I believe I found the problem. I used "vite" to create all my files and by default they add the JS link with a type of "module" which doesn't work in browsers, but in live-servers.
I already changed my index.html accordingly:
<script src="main.js"></script>and commited the new version. Now I only got the problem, that the pages-hosting algorithm still uses my old index.html file. Maybe somebody got an idea how I can change that?