function Add() {
            if(app.stuForm.form.isValid())
            {
                Ext.MessageBox.show({
                title: '请稍候',
                msg: '数据提交中...',
                progressText: '',
                width: 300,
                progress: true,
                waitConfig:{interval:600},//0.6s进度条自动加载一定长度  
                closable:true, 
                wait:true, 
                animEl: '数据处理中......'
                fn:doAction });
                setTimeout(function(){Ext.MessageBox.hide()},5000);
                app.stuForm.form.doAction('submit',{
                    url: '../Commen/UploadFile.aspx?Opt=addstudent',
                    method:'post',params:'',
                    success:function(form,action){
                        var strSuccess = action.result.success.trim();
                        if(strSuccess == "true")
                        {
                            Ext.Msg.alert('系统提示','   添加成功   ');                            
                        }
                        else
                        {
                            Ext.Msg.alert('系统提示',"   " + action.result.msg+"   " );
                        } 
                    },
                    failure:function(){ 
                        Ext.Msg.alert('系统提示','添加失败,连接服务器失败');
                    }                
                });
            }
    }提交了这个之后,执行了后台,且后台返回了response.write(success:true),这个是神马状况,为什么不能执行sucess或者failure,难道是后台的数据,前台没有接受到后台返回的东西?求解释。ExtJSJavaScriptweb

解决方案 »

  1.   

    有没有alert strSuccess 看看返回到前台的是什么值
      

  2.   

    根本就没有进入success啊,我再
     success:function(form,action){  
    alert("测试");                      
     var strSuccess = action.result.success.trim(); 
    alert(strSuccess);
    这两个alert都没有输出
      

  3.   

    你确定后台已经传回数据到前台了?
    firebug看一下
      

  4.   

    我看了一下[-] json "success:true \r\n<FORM id=form1 method=post name=form1 action=UploadFile.aspx?Opt=addstudent>\r\n<DIV><INPUT id=__VIEWSTATE name=__VIEWSTATE value=/wEPDwUJNzgzNDMwNTMzZGR7jl4q15iWR6t6VyZTPzKsQre7wg== type=hidden> </DIV\r\n<DIV></DIV></FORM>
      

  5.   

    [-] json "success:true \r\n<FORM id=form1 method=post name=form1 action=UploadFile.aspx?Opt=addstudent>\r\n<DIV><INPUT id=__VIEWSTATE name=__VIEWSTATE value=/wEPDwUJNzgzNDMwNTMzZGR7jl4q15iWR6t6VyZTPzKsQre7wg== type=hidden> </DIV>\r\n<DIV></DIV></FORM>"