In HTML5, you no longer need to include the type in a script tag when you are using JavaScript.
Are any common browsers (IE6+, Firefox 2+, Safari 3+, Opera 9+ or similar) going to break if the type is removed from all the <script> tags?
So, is changing the following:
<script type="text/javascript" src="/path/js.js"></script>
<script type="text/javascript">
...
</script>
to:
<script src="/path/js.js"></script>
<script>
...
</script>
… going to break anywhere?
No it won’t break any of the popular browsers, including the ones you mention. The
<script>tag will work fine without thetypeattribute, because all popular browsers will default to JavaScript.Quoting Douglas Crockford: