未捕获的TypeError:对象[object Object]没有方法'get_name'

时间:2013-09-25 15:22:54

标签: javascript dopostback

我的for循环后,我的javascript函数出现了以下错误:

  

未捕获TypeError:对象[object Object]没有方法'get_name'

没有运行dopostback

function fnCollapseAll() {
    var currentBehavior = null;
    var allBehaviors = Sys.Application.getComponents();
    for (var loopIndex = 0; loopIndex <= allBehaviors.length; loopIndex++) {
        currentBehavior = allBehaviors[loopIndex];
        if (currentBehavior.get_name() == "CollapsiblePanelBehavior") {
            if (!currentBehavior.get_Collapsed()) {
                currentBehavior.set_Collapsed(true);
            }
        }
    }
    __doPostBack('<%=m_CollapseAllDIV.ClientID%>', 'Collapse All');
 }

0 个答案:

没有答案