JavaScript: Inline Script with SRC Attribute
JavaScript inline scripts are commonly included using the
JavaScript inline scripts are commonly included using theJavaScript inline scripts are commonly included using the
According to the HTML 4.01 Specification, the behavior of a <script> tag with both an inline script and a src the behavior of a <script> tag with both an inline script and a srctrib明確的:</script>
如果src 屬性未設置,用戶代理必須將元素的內容解釋為腳本。如果 src 有 URI 值,使用者代理程式必須忽略元素的內容並透過 URI 檢索腳本。
<code class="html"><script type='text/javascript' src='/path/to/script.js'></script></code>
在此範例中,inline 腳本將被忽略,因為 src 屬性存在。要執行 inline 腳本,必須省略 src 屬性:<🎜><🎜>以上是您可以在標籤中同時包含內聯腳本和 SRC 屬性嗎?的詳細內容。更多資訊請關注PHP中文網其他相關文章!