Skip to content

Commit

Permalink
Remove redundant type="text/javascript" from <script> elements
Browse files Browse the repository at this point in the history
In HTML5, <script> elements default to MIME type text/javascript. The
HTML5 living standard and MDN recommend against including the attribute.

From https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type

> The HTML5 specification urges authors to omit the attribute rather
> than provide a redundant MIME type.

From https://html.spec.whatwg.org/#the-script-element

> Authors should omit the type attribute instead of redundantly setting
> it.
  • Loading branch information
jdufresne authored and AA-Turner committed Jan 8, 2024
1 parent 880804d commit ac3b43f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alabaster/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
{% endif %}

{% if theme_analytics_id %}
<script type="text/javascript">
<script>

var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ theme_analytics_id }}']);
Expand All @@ -114,7 +114,7 @@
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
var ga = document.createElement('script'); ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
Expand Down

0 comments on commit ac3b43f

Please sign in to comment.