PDA

View Full Version : dom error



EvilKnight
18 Jun 2012, 2:01 AM
Hi, i having this error:

FireFox shows: dom.classList is undefined
Chrome shows: Uncaught TypeError: Cannot call method 'contains' of undefined

Anyone can tell me what normally caused this error?

chramer
18 Jun 2012, 5:40 AM
what are you trying to do? when/where the error occurs?
some code also would be helpful

scottmartin
18 Jun 2012, 12:06 PM
You are trying to access something that is either not defined ... belongs another class than you expected or not in the current scope.

As mentioned, you will need to provide more detail than you provided.

Scott.

EvilKnight
18 Jun 2012, 6:48 PM
Yes, sure. was abit in a rush, so forgotten to paste my coding.
This error not happening when I use IE.
It work fine when I previously use EXTJS3.

Part of my EXTJS Coding:

Ext.define('My.LoginPanel', {
extend: 'Ext.form.Panel',
frame: true,
height: 140,
width: 350,
initComponent: function() {


this.username = Ext.create('Ext.form.field.Text', {
name: 'username',
fieldLabel: 'Username:',
allowBlank: false,
scope: this
});


this.password = Ext.create('Ext.form.field.Text', {
fieldLabel: 'Passwrd:',
inputType: 'password',
name: 'password',
scope: this
});


Ext.apply(this, {
items: [this.username, this.password],
buttons: [{
text: 'login',
scope: this,
handler: this.login
}]
});


this.callParent(arguments);
}
})


Part of my HTML Coding:


<script type="text/javascript">
Ext.BLANK_IMAGE_URL = 'images/blank.gif';
Ext.QuickTips.init();
Ext.ns('My.page');
My.page.Login = function() {
var loginForm;
return {
init: function() {
loginPanel = Ext.create('My.LoginPanel', {
el: 'divLogin',
listeners: {
scope: this,
connectSuccess: function(form, action) {
alert('Yes success');
},
connectFail: function(form, action) {
alert('No, YOU FAIL!!!');
}
}
});
loginPanel.getPanel().waitMsgTarget = loginPanel.getEl();
loginPanel.render();
loginPanel.username.focus();
},

getPanel: function() {
return loginPanel;
}
};
} ();
Ext.onReady(My.page.Login.init, My.page.Login);
</script>
</head>
<body>

<div id="divLogin" class="loginbox"> </div></body>