Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 只有Internet Explorer给出错误:';document.getElementById(…)和#x27;是否为null或不是对象_Javascript_Html_Css_Internet Explorer_Asp Classic - Fatal编程技术网

Javascript 只有Internet Explorer给出错误:';document.getElementById(…)和#x27;是否为null或不是对象

Javascript 只有Internet Explorer给出错误:';document.getElementById(…)和#x27;是否为null或不是对象,javascript,html,css,internet-explorer,asp-classic,Javascript,Html,Css,Internet Explorer,Asp Classic,我正在处理asp项目,但在internet explorer 8上运行此项目时,会出现以下错误: “document.getElementById(…)”为null或不是对象 正如Passerway所说,没有id为“infomsg_rmsg”的元素,因此您无法访问null对象的innerHTML属性。如果它确实存在(请检查您的源代码以确认),那么原因可能是您在DOM完成加载之前调用了此内联(…)。尝试从onload处理程序调用相同的函数,看看是否检测到它 此外,我怀疑你的HTML可能是坏的,所以

我正在处理asp项目,但在internet explorer 8上运行此项目时,会出现以下错误:

“document.getElementById(…)”为null或不是对象


正如Passerway所说,没有id为“infomsg_rmsg”的元素,因此您无法访问null对象的innerHTML属性。如果它确实存在(请检查您的源代码以确认),那么原因可能是您在DOM完成加载之前调用了此内联(
)。尝试从
onload
处理程序调用相同的函数,看看是否检测到它

此外,我怀疑你的HTML可能是坏的,所以在你做任何事情之前,请确保你的HTML


最后,如果你能写出更好的问题,那么你会得到更好的答案。你的问题中有太多缺少的HTML/脚本,除了猜测之外什么也做不了。

plz也发布HTML或创建JSFIDdle我不知道这是否是复制/粘贴错误,但你的示例中的括号不匹配是的,伙计,我只是复制paste@AnupKaranjkar我们不知道哪一行是285。您可能希望以某种方式添加它……该错误意味着在执行该脚本时,没有id为“infomsg\u rmsg”的元素。
        if (obj == 18){
            var name18=document.getElementById("infomsg-18");
            if (name18 != null)
            {
                name18.style.display='none';
            }
        }                                   
    }
    else
    {
        //line:285
        document.getElementById('infomsg_rmsg').innerHTML = 'Info:...'+xmlhttp.status;
        //document.getElementById('Divajax').innerHTML = xmlhttp.statusText;
    }
}
xmlhttp.open("GET","/Reset_ModifFlagSession.asp",false);
xmlhttp.send();