Robin Rodricks
Robin Rodricks

Reputation: 114136

Are HTML script elements allowed to be external even when in the body?

In HTML, are <script> elements allowed to be external and use <script src="myscript.js"> even when in the <body> of the document?

Upvotes: 3

Views: 289

Answers (1)

Matthew James Taylor
Matthew James Taylor

Reputation: 4866

Yes. This is how a lot of widgets work like Google Maps. Make sure you specify the type though:

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

Upvotes: 11

Related Questions