FredTheHomie
FredTheHomie

Reputation: 41

how to HTML link to external js file

I am trying to simply copy and paste the code from this link, but it seems that the javascript file is not being picked up. The HTML and CSS are working just fine, but I can't seem to link the javascript file. I am not sure why, any help would be appreciated.

Also here is the code linking my js file to the HTML.

<script style="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>

<script type="text/javascript" src="script.js"></script>

Upvotes: 0

Views: 3646

Answers (3)

Dennisrec
Dennisrec

Reputation: 333

As can see, the script links very well as I have tested it. However, please change [the attribute is type not style]

<script style="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>

to

<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>

Upvotes: 2

pascalallen
pascalallen

Reputation: 336

This:

<script style="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>

Should be:

<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>

Change style to type.

Upvotes: 4

Kavica
Kavica

Reputation: 56

Should the top line say "type=" and not "style="?

Upvotes: 2

Related Questions