Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.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 如何在IE11中添加未定义或引用的属性_Javascript_Html_Css - Fatal编程技术网

Javascript 如何在IE11中添加未定义或引用的属性

Javascript 如何在IE11中添加未定义或引用的属性,javascript,html,css,Javascript,Html,Css,//如果返回值未定义,则必须为“取消”。请提供有关这一问题的任何有用信息。 当我们试图在返回流中的IE11浏览器中启动jsp页面时,就会出现此问题 //if the return value is undefined, then it must be "cancel" if (typeof returnValue == "null") { document.getElementById("user").value = "cancel"; } else {

//如果返回值未定义,则必须为“取消”。请提供有关这一问题的任何有用信息。 当我们试图在返回流中的IE11浏览器中启动jsp页面时,就会出现此问题

    //if the return value is undefined, then it must be "cancel"
    if (typeof returnValue == "null") {
        document.getElementById("user").value = "cancel";
    } else {
        //set value of various form elements, based on returnValue
    }

    postCommand(null, "redirect", "serversideredirect", "", "");
}

</script>
//如果返回值未定义,则必须为“取消”
如果(返回值的类型==“null”){
document.getElementById(“用户”).value=“取消”;
}否则{
//基于返回值设置各种表单元素的值
}
postCommand(null,“重定向”、“服务器侧重定向”、“重定向”);
}

您正在尝试执行

 document.getElementById("userAction").value = "cancelled";
当主体中的id为lblAction

<b><label style="HEIGHT:25px; FONT-SIZE:12pt" id="lblAction"></label></b>
。。。应该成为

document.getElementById("lblAction").value = "cancelled";'

这意味着你期望存在的元素之一实际上不存在。您的代码应该检查
getElementById()
的返回值是否不是
null
'document.getElementById(“userAction”).value=“cancelled”;'应变为“document.getElementById(“lblAction”).value=“已取消”;”
document.getElementById("lblAction").value = "cancelled";'