2013-06-05 74 views
-3

我的网站不断下面的代码片段抛出一个JavaScript错误:正式参数失踪)参数JavaScript错误

任何想法后失踪):

<script> 
Ext.onReady(function(
    $('.tab2').click(function(){ 
    Ext.WindowManager.bringToFront('.tab-2'); 
    }); 
    $('.tab1').click(function(){ 
    Ext.WindowManager.bringToFront('.tab-1'); 
    }); 
}); 
</script> 

错误:SyntaxError错误?谢谢!

回答

4
Ext.onReady(function(

应该

Ext.onReady(function(){ 
4

你的语法错误是在这条线:

Ext.onReady(function(

将其更改为:

Ext.onReady(function(){ 
1

尝试

Ext.onReady(function() { //missing) { here 
    $('.tab2').click(function() { 
     Ext.WindowManager.bringToFront('.tab-2'); 
    }); 
    $('.tab1').click(function() { 
     Ext.WindowManager.bringToFront('.tab-1'); 
    }); 
}); 
0
Ext.onReady(function() { 
    $('.tab2').click(function() { 
    Ext.WindowManager.bringToFront('.tab-2'); 
    }); 
    $('.tab1').click(function(){ 
    Ext.WindowManager.bringToFront('.tab-1'); 
    }); 
}); 

缺少区域:Ext.onReady(function() {

0

应该

Ext.onReady(function() { 

所以,替换像

<script> 
    Ext.onReady(function(){   //Add here 
    $('.tab2').click(function(){ 
     Ext.WindowManager.bringToFront('.tab-2'); 
    }); 
    $('.tab1').click(function(){ 
     Ext.WindowManager.bringToFront('.tab-1'); 
    }); 
    }); 
</script> 
0

下面是语法错误:

Ext.onReady( FUNC重刑(

应该是这样的:

Ext.onReady(function(){ 
0

正确方法:

<script> 
Ext.onReady(function(){ 
    $('.tab2').click(function(){ 
     Ext.WindowManager.bringToFront('.tab-2'); 
    }); 
    $('.tab1').click(function(){ 
     Ext.WindowManager.bringToFront('.tab-1'); 
    }); 
} 
); 
</script> 
0

函数体不能在参数

使用

Ext.onReady(函数(传递){enter code here

});