r/javascript • • Mar 01 '16

Udemy offering javascript course with JAVA logo

Post image
413 Upvotes

121 comments sorted by

View all comments

Show parent comments

14

u/thebezet Mar 01 '16

Also, has anyone noticed the <script> tag after the </body> tag?

2

u/IMHERETOCODE Mar 01 '16

Why is that bad? Honestly curious, because it works just fine.

10

u/MrCzar Mar 01 '16

Only comments and the end tag for the html element are allowed after the end tag for the body.

Browsers may perform error recovery, but you should never depend on that.

IE doesn't allow this anymore and will ignore such scripts. Firefox and Chrome still tolerate them, but there are chances that some day they will drop this as non-standard.

1

u/thebezet Mar 01 '16

It will not validate and may not even work on some browsers. You might as well put it outside </html>.