我的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');
}