Microsoft JScript 运行时异常: “Popup”未定义这如何避免

Microsoft JScript 运行时错误: “Popup”未定义这如何处理? function Hide() {if (Popup ! null) {Popup.s

Microsoft JScript 运行时错误: “Popup”未定义这如何处理?


 function Hide() {
        if (Popup != null) {
            Popup.style.display = "none";
        }






Microsoft JScript 运行时错误: “Popup”未定义,如何定义Popup呢?如何让IE不报错,

1:就是没有定义如何让IE不报错?
2:如何定义Popup呢?
[解决办法]



 function Hide() {
        if(typeof(Popup)!="undefined") {
            Popup.style.display = "none";
        }





[解决办法]
var Popup=document.getElementById("Popup")??