我习惯包括和使用JS这样:
<script type='text/javascript' src='/path/to/script.js'></script>
....
<script type='text/javascript'>
alert('Do some stuff here, using resources defined in script.js.');
</script>
Run Code Online (Sandbox Code Playgroud)
出于好奇,有没有人知道有一个带有src attrib的内联脚本的规则,如:
<script type='text/javascript' src='/path/to/script.js'>
alert('Do some stuff here, using resources defined in script.js.');
</script>
Run Code Online (Sandbox Code Playgroud)
我可以测试在各种浏览器中会发生什么,但想知道官方行为是什么.