[whatwg] Allow trailing slash in always-empty HTML5 elements?

2006/12/1, Ian Hickson <ian at hixie.ch>:
<...>
> > An example of something that is NOT implemented interoperably is
> > <script src="..."/>.
>
> As far as I can tell, <script/> is handled by all browsers the same way as
> <script>. How is it not interoperable?

That's true, however, what happens depends on the browser and presence
of </script> in the code.

When IE encounters <script  type="text/javascript" src="somescript.js"
/> it swallows everything after as the content of script. If there is
no </script> in the source - that's it.

Firefox likes consistency: <script  type="text/javascript"
src="somescript.js" /> works OK,

This is OK too:

<script  type="text/javascript" src="somescript.js" />
<p>some text</p>
<script  type="text/javascript" src="somescript2.js" />

However
<script  type="text/javascript" src="somescript.js" />
<p>some text</p>
<script  type="text/javascript" src="somescript2.js"></script>

Produces only single SCRIPT in DOM tree swallowing paragraph and the
second <script>.

Opera handles the last example just fine.

Regards,
Rimantas
--
http://rimantas.com/

Received on Friday, 1 December 2006 03:07:20 UTC