Skip to content Skip to sidebar Skip to footer

Can't Attach Local Javascript File To Html

I can't seem to attach my local Javascript file to the page: My Website<

Solution 1:

The src path is relative to the html file. If both are in the same directory, then try:

<scripttype="text/javascript"src='Application.js'></script>

if in a subdirectory

<scripttype="text/javascript"src='dirName/Application.js'></script>

if in a parent directory

<scripttype="text/javascript"src='../Application.js'></script>

However, make sure that the JS file is somewhere in the hierarchy of the root directory of your website, that is the root folder that your web server uses.

Post a Comment for "Can't Attach Local Javascript File To Html"