Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/432.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript extjs的问题_Javascript_Ajax_Extjs - Fatal编程技术网

Javascript extjs的问题

Javascript extjs的问题,javascript,ajax,extjs,Javascript,Ajax,Extjs,我写了一段代码,在本地主机上运行得非常好,但在我的生产服务器上,我显示了错误响应。附加到提交按钮的成功事件上的结果参数没有定义,但在本地服务器上一切正常,我在服务器上重新发布了主extjs包,认为一些文件已损坏,这个问题仍然存在,我不知道还能做什么,我的代码列在下面 给出的主要问题是“结果、数据、级别 Ext.onReady(函数(){ Ext.QuickTips.init() var login=new Ext.FormPanel({ id:“登录表单”, renderTo:'login2',

我写了一段代码,在本地主机上运行得非常好,但在我的生产服务器上,我显示了错误响应。附加到提交按钮的成功事件上的结果参数没有定义,但在本地服务器上一切正常,我在服务器上重新发布了主extjs包,认为一些文件已损坏,这个问题仍然存在,我不知道还能做什么,我的代码列在下面

给出的主要问题是“结果、数据、级别

Ext.onReady(函数(){ Ext.QuickTips.init()

var login=new Ext.FormPanel({
id:“登录表单”,
renderTo:'login2',
url:“../server/login.ashx”,
标题:“输入您的Pin码和门框号”,
宽度:280,
身高:250,
labelAlign:“顶部”,
bodyStyle:'宽度:300px;高度:300px;边距:0自动;',
框架:对,
项目:[
{xtype:'textfield',fieldLabel:'Registration numbers',name:'reg',width:'70%',allowBlank:false,minLegth:5,maxLength:15},
{xtype:'textfield',fieldLabel:'Pin Number',name:'Pin',id:'Pin',width:'70%,
allowBlank:false,inputType:'password',minLegth:5,maxLength:15,minLengthText:'密码长度必须至少为6个字符。'
}
],
按钮:[{
文本:“登录”,
处理程序:函数(){
pin=Ext.get('pin').getValue();
login.el.mask('请稍候','x-mask-load');
login.getForm().submit({
url:“../server/login.ashx”,
成功:功能(loginForm,resp){
login.getForm().reset();
var级别=响应结果数据级别;
如果(级别=“0”){
controller.getLayout().setActiveItem(1);
}
否则如果(级别=“1”){
controller.getLayout().setActiveItem(2);
load();
}
否则{
document.location=“../hostelAllocation/Report.aspx?val=“+pin;
}
},
失败:函数(loginForm,resp){
login.el.unmask();
var状态=resp.result.data.status;
var reg=resp.result.data.reg;
如果(状态=“0”){
Ext.MessageBox.alert('Failure','Invalid Pin!');
}
否则{
Ext.MessageBox.alert('Failure','pin已被其他用户使用,
用户名:'+reg); } } }); } }, {文本:“取消”, 处理程序:函数(){ document.location=“../index.htm” } }] });
检查你的服务器/login.ashx文件。如果它在你用来检查本地实例的同一个浏览器中工作,那么它可能不是代码。我很确定这是login.ashx错误,而不是Javascript错误。

我真的需要知道这个问题的解决方案。有什么帮助吗?试着用Firebug找出
resp.result
中的内容(尝试
console.log(resp)
在您的
成功
失败
功能中。WoLpH先生,我非常感谢您的专业建议,问题源于我的生产服务器。服务器配置为支持Dot Net framework 2.0,但我在本地服务器上使用了一些.Net 4.0功能。因此,我已经解决了它,它工作得非常好,谢谢,上帝保佑!Darren先生,我真的很感谢你的专业建议,问题源于我的生产服务器。服务器配置为支持Dot Net framework 2.0,但我在本地服务器上使用了一些.Net 4.0功能。因此我已经解决了它,它工作得很好,谢谢,上帝保佑!
var login = new Ext.FormPanel({
    id: 'login_form',
    renderTo: 'login2',
    url: '../server/login.ashx',
    title: 'Enter your Pin Number and Jamb Number',
    width: 280,
    height: 250,
    labelAlign: 'top',
    bodyStyle: 'width:300px;height:300px;margin:0 auto;',
    frame: true,
    items: [

  { xtype: 'textfield', fieldLabel: 'Registration Numberss', name: 'reg', width: '70%', allowBlank: false, minLegth: 5, maxLength: 15 },
  { xtype: 'textfield', fieldLabel: 'Pin Number', name: 'pin', id: 'pin', width: '70%',
      allowBlank: false, inputType: 'password', minLegth: 5, maxLength: 15, minLengthText: 'Password must be at least 6 characters long.'
  }
  ],
    buttons: [{
        text: 'Login',
        handler: function () {
            pin = Ext.get('pin').getValue();

            login.el.mask('Please wait', 'x-mask-loading');
            login.getForm().submit({
                url: '../server/login.ashx',
                success: function (loginForm, resp) {



                    login.getForm().reset();
                    var level = resp.result.data.level;
                    if (level == "0") {
                        controller.getLayout().setActiveItem(1);
                    }
                    else if (level == "1") {
                        controller.getLayout().setActiveItem(2);
                        hostelData.load();
                    }
                    else {
                        document.location = "../hostelAllocation/Report.aspx?val=" + pin;

                    }



                },
                failure: function (loginForm, resp) {

                    login.el.unmask();


                    var status = resp.result.data.status;
                    var reg = resp.result.data.reg;
                    if (status == "0") {
                        Ext.MessageBox.alert('Failure', 'Invalid Pin!');
                    }
                    else {
                        Ext.MessageBox.alert('Failure', 'The pin has been used by another user,<br/> with User Name: ' + reg);
                    }

                }

            });

        }
    },
    { text: 'Cancel',
        handler: function () {
            document.location = "../index.htm"
        }

    }]

});