Script tag in XHTML

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-04-20T01:38:09Z Indexed on 2010/04/20 1:43 UTC
Read the original article Hit count: 486

Filed under:
|
|

Hi,

This might sound like a reaaaally dumb question but...

why do browsers have a fit with this syntax:

<script type='text/javascript' src="/path/to/my.js" />

and want this instead

<script type='text/javascript' src="/path/to/my.js"></script>

Seems the first construct should be valid since there's no inner content to the tag..

?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about XHTML