这个是代码片段: this.add(this.items);
alert('ok--------')
},
add: function(item, scope){
scope = scope || this;
if($.isArray(item)){ //--------------数组形式
for(var i=0,len=item.length; i<len; ++i){
arguments.callee(item[i], this);
}
return;
}
if($.isPlainObject(item)){ //-------简写形式
if(item==='-'){
item = new Toolbar.items.Separator();
}else if(item.type){
item = new Toolbar.types[item.type](item);
}
}else{ //----------------------------实例形式
if(item.type==='panel'){ //容器型组件
scope.addPanel(item.align, item.doc);
}else{ //单一组件
scope.jCell = $('<td></td>');
item.appendTo(scope.jCell);
if(item.align==='right'){
scope.jRight.prepend(scope.jCell);
}else{
scope.jLeft.append(scope.jCell);
}
}
}
alert('ok')
},
一直在FF开发,今天在IE一测试,不好使了虽然是预料中的事,不过原因太蹊跷了啊上面的代码在FF打印 ok ok---------
在IE就打印 ok 然后报错 'type'为空或不是对象高手高手,传说中的高手们帮我看看啊~~
alert('ok--------')
},
add: function(item, scope){
scope = scope || this;
if($.isArray(item)){ //--------------数组形式
for(var i=0,len=item.length; i<len; ++i){
arguments.callee(item[i], this);
}
return;
}
if($.isPlainObject(item)){ //-------简写形式
if(item==='-'){
item = new Toolbar.items.Separator();
}else if(item.type){
item = new Toolbar.types[item.type](item);
}
}else{ //----------------------------实例形式
if(item.type==='panel'){ //容器型组件
scope.addPanel(item.align, item.doc);
}else{ //单一组件
scope.jCell = $('<td></td>');
item.appendTo(scope.jCell);
if(item.align==='right'){
scope.jRight.prepend(scope.jCell);
}else{
scope.jLeft.append(scope.jCell);
}
}
}
alert('ok')
},
一直在FF开发,今天在IE一测试,不好使了虽然是预料中的事,不过原因太蹊跷了啊上面的代码在FF打印 ok ok---------
在IE就打印 ok 然后报错 'type'为空或不是对象高手高手,传说中的高手们帮我看看啊~~
从 alert('ok')
到 alert('ok--------')
这段时间,IE到底做了些什么啊??????????????
for(var i=0,len=item.length; i<len; ++i){
arguments.callee(item[i], this);
}
return;
}
=>
arguments.callee(item[i], scope);
呢
這是什麽?LZ還讓咱們猜吧?
if(item==='-'){
item = new Toolbar.items.Separator();
}else if(item.type){
item = new Toolbar.types[item.type](item);
}
alert('ok--------')了吗?居然没有