一个测试javascript的简单脚本
<!DOCTYPE html>
<meta charset="utf-8">
<title>Minimal Example</title>
<h1 id="header">This is JavaScript</h1>
<script>
document.body.appendChild(document.createTextNode('Hello World!'));
var h1 = document.getElementById('header'); // holds a reference to the <h1> tag
h1 = document.getElementsByTagName('h1')[0]; // accessing the same <h1> element
</script>
<noscript>Your browser either does not support JavaScript, or has it turned off.</noscript>
在Chrome中工作正常。
在IE11中不是这样,即使我启用了脚本
我需要做什么?
(这是IE11
答案 0 :(得分:1)
在桌面上运行IE时,脚本会被视为已阻止的内容,直到用户允许它们为止。在浏览器的底部,您应该有一个黄色条,要求您“允许阻止的内容”#34;。单击它以运行脚本。
答案 1 :(得分:1)
在NoGray提供的this link中找到答案