JavaScript JavaScript Basics Hello, JavaScript! Add JavaScript to HTML

Yunghung Chen
PLUS
Yunghung Chen
Courses Plus Student 246 Points

i type the <script> and other information like in the video but when i refresh the webpage it doesnt have the massage

i type the <script> and other information like in the video but when i refresh the webpage it doesnt have the massage

Yunghung Chen, I had the same problem it turns out that I didn't save both files (script.js and html)

Yunghung Chen
Yunghung Chen
Courses Plus Student 246 Points

hi Washington Simelane i tried that like save the files but still when i refresh i didnt do anything to the website thank you

Clayton Bailey
Clayton Bailey
1,453 Points

I am having this same issue. In the index.html file I have the <script scr="js/script.js"></script> and in the Scripts.js file I have the alert("Hey, you're back for more?"); I have saved both files and when I click the preview button and hit refresh it doesn't seem to execute because the dialog box doesn't appear. Any Ideas?

1 Answer

raymond lu
raymond lu
3,081 Points

You have to make sure that script.js is in the js folder or else it won't be able to find script.js. I was running into that issue as well. I don't know if this solution will work for you.

Jabari Peterson
Jabari Peterson
1,770 Points

Thanks Raymond. This helped a lot.