Mor*_*eng 13 javascript inline-scripting
我想知道如果一个脚本标签同时具有"src"和内联脚本.我试过下面的代码.
<script src="http://yui.yahooapis.com/2.8.1/build/yahoo/yahoo-min.js" type="text/javascript" charset="utf-8">
alert('hello');
</script>
<script type="text/javascript" charset="utf-8">
alert(YAHOO);
</script>
Run Code Online (Sandbox Code Playgroud)
它似乎从未在Firefox和Chrome中执行过"alert('hello')".我试图将src更改为指向不存在的URI."alert('hello')"也没有被执行.
那么,如果脚本标记中有src属性,则始终会忽略内联脚本?