0
爲什麼這個HTML /腳本(來自「JavaScript忍者的祕密」)渲染?JavaScript渲染
<html>
<head>
<script>
function outer(){
var a = 1;
function inner(){ /* does nothing */ }
var b = 2;
if (a == 1) {
var c = 3;
}
}
outer();
assert(true,"some descriptive text");
assert(typeof outer==='function',
"outer() is in scope");
assert(typeof inner==='function',
"inner() is in scope");
assert(typeof a==='number',
"a is in scope");
assert(typeof b==='number',
"b is in scope");
assert(typeof c==='number',
"c is in scope");
</script>
</head>
<body>
</body>
</html>
因爲您沒有導入包含assert函數的必要腳本。 –
你期望呈現什麼?我看到一個空的'
'元素。 – Bergihttp://fiddle.jshell.net/BCL54/show/的源代碼無效,您不能將整個HTML文檔放在那裏 – Bergi