什么是嵌入式JavaScript? [英] What is inline javascript?
问题描述
-
我说inline javascript意味着javascript
-
我的程序员意味着inline javascript是1行的javascript,并且像
< button onclick =alert('test')>
我给他的权利,内嵌JavaScript也是onclick ='alert(...)
因为它再次像我solutin#1,所有JavaScript加载HTML而不是JS。
谁是对的?
我们有一个HTML文件,并且有< script> ....< / script>
javascript在底部,也就是内嵌javascript,对吗?
不带脚本
标签(即直接在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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!