问题描述
-
我说inline javascript意味着javascript
-
我的程序员意味着inline javascript是1行的javascript,并且像
不带 src 的脚本标签(即直接在HTML文档)被称为内联脚本。
一个 onclick =... attrib ute被称为内联事件处理程序。
Me and my programmer has 2 different views for what "Inline JavaScript" is.
I said inline javascript means javascript placed directly in the HTML file, without in a .JS file.
My programmer means inline javascript is javascript on 1 line, and like <button onclick="alert('test')">
I give him right in, that inline javascript also is "onclick='alert(...)" because it again is like my solutin #1, all javascript loaded in HTML and not in JS.
Who's right?
We have a HTML file, and there is <script>....</script> javascript in the bottom, that is inline javascript, right?
解决方案A script tag without a src (ie. with code directly in the HTML document) is referred to as an inline script.
An onclick="..." attribute is called an inline event handler.
这篇关于什么是嵌入式JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!