Ask coding questions

← Back to all posts
Scrpt.js Is not Loading! (Node.js EJS)
ErrorbotTHE2nd (7)

So I Just converted my HTML Repl to a Node.js Repl and changed the HTML file to an EJS file and now my script.js File won't load! Everything renders like before but now no code works. How I know script.js is not loading is because in the file, before everything I added document.html = "test" and nothing happened.

Answered by OmN3xin (51) [earned 5 cycles]
View Answer
OmN3xin (51)

your static folder("views") is the path in which you start all your paths; In your main.ejs file, change your scripts src into /Home/script.js since you path starts at your static folder("views"), then adds this path onto it :)