克隆的<script>标记不会执行.为什么?
例:
<script id="hello">
console.log("hello execution count ", window.helloCount++);
</script>
<script id="action">
document.body.appendChild(
document.getElementById('hello').cloneNode(true));
console.log('cloned the script');
</script>
Run Code Online (Sandbox Code Playgroud)
执行后,文档中有两个hello脚本,但只执行了一个.
http://jsbin.com/zuxoro/1/edit?html,console,output
这是我正在研究的一个更大问题的一部分,所以我知道这是一件愚蠢的事情.