Home  >  Article  >  Web Front-end  >  Solve the browser compatibility issue where ExtJS is displayed normally in Chrome or Firefox but not in IE_extjs

Solve the browser compatibility issue where ExtJS is displayed normally in Chrome or Firefox but not in IE_extjs

WBOY
WBOYOriginal
2016-05-16 17:43:531383browse

I have been developing with ExtJS for nearly a year, and I have encountered many strange problems. The most impressive one is the display problem of ExtJS in IE. Since most of the development process uses Chrome for debugging and rarely debugs in IE (now both have to be taken into consideration), the page in IE finally failed to load normally. It was embarrassing at the time. When I saw the error reported by IE, I thought Crying, I don’t even have the stack information of the error (IE is really bad at this), so I can’t start. After trying many methods, I finally found that the cause of this problem (more than 90% possibility) is that there is an extra English comma ',' in the js array, and this is no problem in Chrome and Firefox. , as shown in the following code:

Copy the code The code is as follows:

var win = Ext .create('Ext.window.Window',{
//Omit some code here
//.....
items:[
{
title: 'hello',
width:100,
height:100
},{
title:'world',
width:100,
height:100
}, {
title:'foo',
width:100,
height:100
},//Pay attention to the English comma here, no error will be reported in Chrome and Firefox
]
//Some codes are omitted here
//.....
})

This is a difference in how browsers handle arrays. Everyone should pay attention when writing code. If there are similar problems, you can try to find them and maybe you can solve them. I have encountered this problem three times. (End)^_^
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn