开发者

What's it called when you declare javascript in the <head>

开发者 https://www.devze.com 2023-01-13 12:05 出处:网络
What\'s it called when you declare javascript in the <head>? It\'s not external, and it\'s not inline...it\'s called something else. What is it?

What's it called when you declare javascript in the <head>? It's not external, and it's not inline...it's called something else. What is it?

<html>
<head>
<script type="text/javascript">
function message()
{
alert("This alert box was called with the onload event");
}
</script>
</head>

<body onload="message()">
</body&开发者_JAVA百科gt;
</html>

edit: google helped me find the word i was looking for - internal. i saw it used in the context of external/internal/inline css. is internal javascript an appropriate term?


Inline is any javascript that's literally embedded in a page, whether it's in the head or body. If it's in an external file you include via <script src="..."><script>, then it's not inline anymore.


It is inline JavaScript, it's just inline in the head, rather than inline in the body.

0

精彩评论

暂无评论...
验证码 换一张
取 消