无法获得财产' setActionableButtonState'未定义或空引用

时间:2016-04-29 16:02:15

标签: javascript internet-explorer-11

在IE11上运行以下脚本时出现脚本错误。

错误:

SCRIPT5007: Unable to get property 'setActionableButtonState' of undefined or null reference
File: infoall.js, Line: 995, Column: 3

我的代码:

function setInfoActionableButtonState(enable)
{
    for (var i = 0; i < sections.names.length; ++i)
    {
        var frame = rs.getPane(sections.names[i]);
        if(typeof frame.setActionableButtonState != "undefined" && frame.setActionableButtonState != null)
        {
            try
            {
                frame.setActionableButtonState(enable);
            }
            catch(e)
            {

            }
        }
    }
}

1 个答案:

答案 0 :(得分:0)

错误消息表明您的frame变量为nullundefined。您可能希望在检查frame属性之前检查setActionableButtonState是否已设置。

//          |- === HERE ===
if(typeof frame != "undefined" && typeof frame.setActionableButtonState != "undefined" && ...)