Javascript错误文档.getElementById(';x';).style.display=


Javascript error document.getElementById('x').style.display='none'

此语法有什么错误:PHP

echo '<li onMouseOver="" onMouseOut="document.getElementById('''.$boxrow.''').style.display=''none'';">';

和HTML页面上的源代码:

<li onmouseover="" onmouseout="document.getElementById('evidence').style.display='none';">

它工作得很好,但之后的脚本会导致错误,如果我删除这个脚本,一切都很好。

首先,在这个脚本下面并停止工作的是:

header("Location: index.php?module=service&no=".$_POST['id']."&"); and next after ...

PHP头重定向只有在您仍然没有解析页面上的任何代码的情况下才有效。请尝试使用javascript重定向。

此外,最好不要使用内联javascript。更好:

编辑:

window.onload = function() {
    li.onmouseout=function(){
       document.getElementById('evidence').style.display='none';
    };
};