Ask coding questions

← Back to all posts
Why is my script.js not working? (EJS + Node.js)
ErrorbotTHE2nd (7)

When I try to load my ejs file it loads but the script.js file does not.

I Use Express to load and I load it like this:

app.get("/", (req, res, next) => {

and my ejs file:

    <script src="script.js"></script>

    <div class="STSDiv">
      <button id="recordButton">Start Recording</button>
      <button id="speechButton">Start Speech</button>

      <p id="recordTranscriptP">Say Someting!</p>

but the script.js file does not load.

I know this because I did document.html = "test" and nothing happened.

IDK what happened!