Why does this not work?
<script type="text/javascript" src="//cdn.com/assets/js/jquery.js">
alert("Hello World!");
</script>
But this does?
<script type="text/javascript" src="//cdn.com/assets/js/jquery.js"></script>
<script type="text/javascript">
alert("Hello World!");
</script>
This is general across many HTML tags that pull from source. Micro optimization is important in my situation and I am also curious.
From w3.org (emphasis mine):
If the src has a URI value, user agents must ignore the element's contents and retrieve the script via the URI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With