错误Js无法读取null的属性“ setAttribute”

Dom*_*kis -2 javascript compiler-errors

它说:

index.html:50未捕获的TypeError:无法读取函数document.getElementById(“ bp_infinity”)。style.display =“ block”; 中null的'style'属性

http://i.stack.imgur.com/hODMO.png

非常感谢您的回答。

小智 5

DOM准备就绪之前,JS正在执行。

<script>标签移到结束</body>标签之前,或者将所有Javascript放在类似onload的函数中。window.onload = function(){ /** all code goes here **/};