Hello I\'m having some trouble with the following code within my Index.html file:
src="/clock.js"
be careful it's root of the domain.
P.S. and please use lowercase for attribute names.
Try:
<script src="/clock.js"></script>
Note the forward slash.
The common practice is to put scripts in a discrete folder, typically at the root of the site. So, if clock.js lived here:
/js/clock.js
then you could add this code to the top of any page in your site and it would just work:
<script src="/js/clock.js" type="text/javascript"></script>
Piece of cake!
<SCRIPT LANGUAGE="JavaScript" SRC="/clock.js"></SCRIPT>
If you have
<base href="/" />
It's will not load file right. Just delete it.
This works:
<script src="/clock.js" type="text/javascript"></script>
The leading slash means the root directory of your site. Strictly speaking, language="Javascript"
has been deprecated by type="text/javascript"
.
Capitalization of tags and attributes is also widely discouraged.