为什么网站http://xn--wiadomesny-37b.pl/test/ throws Uncaught TypeError: Cannot set property 'innerHTML' of null
?
HTML ( http://xn--wiadomesny-37b.pl/test/ ):
<div class="castle_array" id="2x1" name="2x1"></div>
<div class="castle_array" id="3x1" name="3x1"></div>
<div class="castle_array" id="4x1" name="4x1"></div>
...
JavaScript ( http://xn--wiadomesny-37b.pl/test/B_modeWindow.js ):
for (x = 1; x <= 5; x++) {
for (y = 1; y <= 5; y++) {
document.getElementById(x+"x"+y).addEventListener("click",B_modeWindow('1',this.id));
}}
当我改变
("click",B_modeWindow('1',this.id)
到
("click",B_modeWindow('1','string')
它就像一个魅力 - 为什么?