我收到以下错误,它是什么意思,我怎么能解决它。对我来说一切似乎都好,我一行一行但在代码中找不到任何异常。
[INFO]成功回调错误:NetworkStatus0 = TypeError:Result 表达式'(userAgent,navigation.platform)'[iPhone]不是 构造
我在下面提供了我的代码,请看一下。告诉我如何摆脱这个错误;
Ext.setup({
onReady: function() {
console.log('application launched Ready OK');
var form;
//form and related fields config
var formBase = {
//enable vertical scrolling in case the form exceeds the
//page height
scroll: 'vertical',
url: 'http://97.74.206.195/web_service/',
items: [{//add a fieldset
xtype: 'fieldset',
title: 'Personal Info',
instructions: 'Please enter the information above.',
//apply the common settings to all the child items
// Getting your form ready with FormPanel
// of the fieldset
defaults: {
required: true,
labelAlign: 'left',
labelWidth: '40%'
}, items: [
//required field
{//add a text field
xtype: 'textfield',
name : 'name',
label: 'Name',
useClearIcon: true,//shows the clear icon in the
//field when user types
autoCapitalize : false
}, {//add a password field
xtype: 'passwordfield',
name : 'password',
label: 'Password',
useClearIcon: false
}, {
xtype: 'passwordfield',
name : 'reenter',
label: 'Re-enter Password',
useClearIcon: true
}, {//add an email field
xtype: 'emailfield',
name : 'email',
label: 'Email',
placeHolder: 'you@sencha.com',
useClearIcon: true
}] }
],
listeners : {
//listener if the form is submitted, successfully
submit : function(form, result){
console.log('success', Ext.toArray(arguments));
},
//listener if the form submission fails
exception : function(form, result){
console.log('failure', Ext.toArray(arguments));
}
},
//items docked to the bottom of the form
dockedItems: [
{
xtype: 'toolbar',
dock: 'bottom',
items: [
{
text: 'Reset',
handler: function() {
form.reset(); //reset the fields
}
}
]
} ]
};
// Check for device
var navigation = Ext.global.navigator,
userAgent = navigation.userAgent,
osEnv, osName, deviceType;
Ext.os = osEnv = new this(userAgent, navigation.platform);
osName = osEnv.name;
var search = window.location.search.match(/deviceType=(Tablet|Phone)/),
nativeDeviceType = window.deviceType;
if (search && search[1]) {
deviceType = search[1];
console.log('application launched Ready OK1');
}
else if (nativeDeviceType === 'iPhone') {
console.log('application launched Ready OK2');
formBase.fullscreen = true;
} else { //if desktop
Ext.apply(formBase, {
autoRender: true,
floating: true,
modal: true,
centered: true,
hideOnMaskTap: false,
height: 385,
width: 480
});
}
//create form panel
form = new Ext.form.FormPanel(formBase);
form.show(); //render the form to the body
console.log('application launched Ready OK3');
}
});