Monday, May 20, 2024
187
rated 0 times [  190] [ 3]  / answers: 1 / hits: 17101  / 13 Years ago, thu, march 17, 2011, 12:00:00



I wrote a program with extjs library, the program works fine in all browsers, except internet explorer 8, the problem is, it works when i load it from localhost, but when accessed from the server, it doesn't load the page, i have a blank page,

I removed a comma and the program started working when accessed from the server. Does someone have an explanation?



here is the header:



 <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<html xmlns=http://www.w3.org/1999/xhtml xml:lang=en lang=en>
<head>
<meta name=Description content=Default Style />
<meta name=Version content=2.1.1 />
<meta http-equiv=Content-Type content=text/html;charset=utf-8 />
<title>project name</title>
<link rel=stylesheet type=text/css href=./style/default/main.css media=all />
<style type=text/css media=all>@import ./style/default/main.css;</style>
<link rel=shortcut icon href=./style/default/images/favicon.ico type=image/ico />
<script type=text/javascript src=http://10.215.63.218/Apsys/js/base.js></script>
<script type=text/javascript src=http://10.215.63.218/app/js/collapse.js></script>
<script type=text/javascript src=http://10.215.63.218/app/lib/overlib/overlib.js></script>
</head>

More From » internet-explorer

 Answers
33

Internet Explorer can't handle trailing commas on objects and arrays. This becomes an especially recurring problem with Ext, where you regularly create large objects, one attribute per line, and comment/remove things a lot.



This will break in IE:



new Ext.Panel({
id: 'mypanel',
cls: 'my-panel-class',
html: 'Some HTML',
colors: [
'yellow',
'blue',
'red',
//'pink'
],
renderTo: Ext.getBody(),
});


Notice the extra comma after 'red' and Ext.getBody() in the first block.



This will work:



new Ext.Panel({
id: 'mypanel',
cls: 'my-panel-class',
html: 'Some HTML',
colors: [
'yellow',
'blue',
'red'
//'pink'
],
myArray: ['yellow', 'blue', 'red'],
renderTo: Ext.getBody()
});

[#93220] Wednesday, March 16, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kylee

Total Points: 60
Total Questions: 119
Total Answers: 101

Location: Bonaire
Member since Wed, Mar 29, 2023
1 Year ago
;