JavaScript Document (8) Events (8) ExtJS (9) Strings (3)
Exchange Links About this site Links to us 
|
Error 'undefined' is null or not an object in Internet Explorer
7 comments. Current rating: (3 votes). Leave comments and/ or rate it.
Question: I am developing a web application using ExtJS and when I open my URL in Firefox (2), everything looks good and works well. In Internet Explorer (6) I get an error message
Error 'undefined' is null or not an object

Any ideas?
Answer: I had the same error once. Look for any array of properties that has a trailing , (comma).
This can happen easily in ExtJS source code where frequently you will have a list of comma separated properties, then you delete the last one of those properties and you forget to remove the trailing comma.
Firefox doesn't complain, but Internet Explorer throws a cryptic error message.
The worst issue is that Internet Explorer gives you a line number and character position that seems worth nothing. It doesn't even tell you, in which source file your bug is.
Do you see the buggy comma in the example below? I marked it red, yet it's still not easy to spot. I guess my source code is messy :-|
 | |  | | gridFruits = new Ext.grid.EditorGridPanel({
store: storeFruits,
cm: new Ext.grid.ColumnModel([
{header:"Fruit", width: 30, sortable:true, dataIndex:'group',
editor:new Ext.form.TextField({allowBlank:false })},
{header:"Vitamin", width: 15, sortable:true, dataIndex:'vitamin'},
{header:"Profile", width: 15, sortable:true, dataIndex:'profile',
renderer: displayProfile},
]),
viewConfig: { forceFit: true },
sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
clicksToEdit:2,
height: 444
});
| |  | |  |
Comments:
|
anonymous from India
|
|
|
|
Hi you have very good habit to crate blogs especially in extjs.
I am beginner in extjs.can u send mail me palpandi.msc@gmail.com
|
|
anonymous from Switzerland
|
 |
|
|
That saved my day! Thanks.
|
|
anonymous from India
|
 |
|
|
Hey buddy ,
Thank u so much.
u'r solution fix ma problem.
u saved ma life :-)
|
|
anonymous from United Kingdom
|
|
|
http://www.jslint.com
Put your javascript through that. It immediately helped me to resolve an error with an extra comma.
|
|
[hidden] from Romania
|
 |
|
|
Hi !
I have an jquery script.
$(function() {
$('#lista_colectie a').imgPreview({
containerID: 'imgPreviewWithStyles',
srcAttr: 'rel',
imgCSS: {
// Limit preview size:
height: 200
},
// When container is shown:
onShow: function(link){
$('<span>' + $(link).text() + '</span>').appendTo(this);
},
// When container hides:
onHide: function(link){
$('span', this).remove();
}
});
});
I have this problem with the error when the page does not contains the #list_colectie a and the components of it.
I have no extra comma i suppose.
Can anybody help?
|
|
anonymous from Poland
|
|
|
|
Thanks for that message! It helps me! I found my comma in my code, when the ie says that bug is in extjs
|
|
anonymous from Hyderabad, India
|
|
|
|
hi
|
|