Home > OS >  How do I import my JS file into my HTML file
How do I import my JS file into my HTML file

Time:08-10

I cant seem to get my js file into HTML, anyone know to to transfer to HTML? I'm running this in python and using a flask server. [This is my javascript code, I'm fairly new to js so just trying it out.1

This is my source folder. Pretty much all my files and folders.

This is my HTML code

CodePudding user response:

Change your calling method from

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

to

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

but, I'm not sure in using Flask, maybe this can help you : https://stackoverflow.com/a/30011819/14963473

CodePudding user response:

Import in html file seems correct. Maybe it's not the problem. Try to add on the beginning of js file:

console.log('ok');

And check if it will show in console.

  • Related