Hello everyone,
I am trying to add some vanilla JavaScript to a website I built on Django. I added a js file in the static file. However, when I inspect the page the JavaScript does not appear. When I check the source, I see that my page has access to the javascript file.
I am really not sure what I am doing wrong. Any advice or help would be much appreciated.
Cheers,
Joumana
Top comments (5)
Hey Joumama, can you post the contents of the JS file and also the HTML page you want it to run in?
Hi Ben,
Thank you for your help. One of the links is HTML & the other is JavaScript.
codeshare.io/amPMVw (HTML)
codeshare.io/anAnVv (JavaScript)
Best,
Joumana
Hmmm... I think this is the issue
Is this where you're trying to load that external JS file? I think it should look like this:
The
<link>
tag is for external css and the<script>
tag is for js. That may be your issue unless I'm missing something. That seems like an easy mistake to make.Woops. Accidentally used the staff account... Logged in to both in separate windows. Gotta stop doing that 😳
Hi Ben! Thanks for the feedback. I changed it to & still not working. I think I will just try & find a different way to make the timeline interactive. Thanks for your help. </p>