External files do not link


#1

Here is the mark up:

Document

Hello

heres my script:

alert(‘JS linked!’);

The script file is in the same folder as the html file(same level) but it does not alert when I refresh.
I experience the same with CSS files.

Thanks,
Jean


#2

Heres the markup


#3

What browser are you viewing that in?


#4

Google chrome


#5

I am starting to get the feeling this may be an issue with live-server. I just ran this on another machine without live-server and had no issues. Gonna do some more testing.
JM


#6

What happens if you run it on the same machine without live-server?

Looking at the atom-live-server documentation, what jumps out at me as a possible area of investigation is the root path setting. If that were doing something incorrectly, it could certainly cause a link to fail.

The Chrome dev tools can be used to find out where Chrome is trying to load files from. Press ctrl-shift-i, find the <script> tag, and hover over the src text.


#7

So here are my screen shots, these should be able to show how the script is in my markup it also shows they are on the same level and I ensured to install live-server globally so the root path shouldn’t be the issue, unless I am misunderstanding. BTW I just ran it using live-server and my script wont run as apposed to when I ran it manually without live-server and it ran just fine. I think this may be an issue with live-server.

Thoughts?

Thanks,
JM


#8


#9

So you’re talking about the Node package live-server and not the Atom package atom-live-server? I definitely can’t help you there.


#10

I see, sorry I did not make this distinction earlier. I will install the atom-live-server now and see how it goes. Thanks.
JM