?? scopeexample2.htm
字號:
<html>
<head>
<title>Scope Example</title>
</head>
<body>
<p>In this example, the <code>var</code> statement <strong>is</strong> used to define
the variable <code>sMyFirstName</code>, so it is created as a variable
at the <code>sayFirstName()</code> scope. This is proved because the second function
causes an error when it tries to access the variable.</p>
<script type="text/javascript">
function sayFirstName() {
var sMyFirstName = "Nicholas";
alert(sMyFirstName);
}
function sayFirstNameToo() {
alert(sMyFirstName);
}
sayFirstName();
sayFirstNameToo();
</script>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -