PDA

View Full Version : Firefox vs. IE 6.0



Captndjc
10-16-2008, 02:24 PM
We have developed a version of the ‘Hello World’ demo to explore new options and techniques for screen design, i.e.(xtype:’fieldset’) or (xtype:’checkboxgroup’). We find that the screen will render under Firefox but not under IE. IE only shows the page to be done but with errors. Are others having the same problem?

richard.milone
10-16-2008, 02:38 PM
Hey Captndjc, can you post up your front-end Valence script?

Captndjc
10-16-2008, 03:57 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Copyright" content="Copyright © 2008 CNX Corporation, All Rights Reserved">
<title>Demo 01 - Hello World</title>
<link rel="stylesheet" type="text/css" href="../extjs/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="../extjs/resources/css/valence.css" />
<script type="text/javascript" src="../extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../extjs/ext-all.js"></script>
<script type="text/javascript">

// This demo program demonstrates how to accept a user name, pass it to a backend RPG program with
// an AJAX call and receive back and display a response.

Ext.onReady(function(){ // Ext.onReady delays execution until page is fully loaded into memory

// -Define Checkbox buttons-
var showActual = new Ext.form.Checkbox({
boxLabel: 'Show Actual',
labelSeparator: '',
checked : true,
inputValue: 1,
columnWidth: .25,
id: 'showActual'
});
var showForcast = new Ext.form.Checkbox({
boxLabel: 'Show Forcast',
labelSeparator: '',
//checked : true,
//inputValue: 1,
columnWidth: .25,
id: 'showForcast'
});

var showAnother = new Ext.form.Checkbox({
boxLabel: 'Show Another',
labelSeparator: '',
//checked : true,
//inputValue: 1,
id: 'showAnother'
});

var callRPG = function() { // the following function will call an RPG program when user clicks "Go"
Ext.Ajax.request({
url: '../valencedev/testor.pgm', // the RPG program name to call
params: {action: 'sayHello',
name: Ext.getCmp('name').getValue()
// showActual: Ext.getCmp('showActual').getValue(),
// showForcast: Ext.getCmp('showForcast').getValue(),
}, // parameters to pass to the RPG program
success: function(response) { // functions to execute once a response comes back from the RPG program
Ext.getCmp('response').setValue(response.responseT ext); // set the "response" field on the page to the value returned from the RPG program
}
});
};

// ### PANELS & MISC COMPONENTS ##################################################
var panelMain = new Ext.FormPanel({ // define a new form called panelMain
frame: true,
header: true,
labelAlign: 'right',
labelWidth: 175,
title: "Hello World",
width: 475, // set various form config options

items:[{
xtype:'fieldset',
title: 'Selection',
autoHeight:true,
items:[{xtype: 'textfield',
id: 'name',
name: 'name', fieldLabel: 'Enter your name',
width:200},
{xtype: 'textfield',
id: 'response',
name: 'response', fieldLabel: 'Response from RPG program',
readOnly: true, width:275
}]
},{
xtype:'fieldset',
// xtype:'checkboxgroup',
title: 'Checkboxs',
layout:'column',
columnWidth: .15,
columns: 3,
autoHeight:true,
items:[ showActual,
showForcast,
showAnother
],
}],
buttons: [ // an array of buttons to include at the bottom of the form
{text: 'Go', id: 'buttonGo', name: 'buttonGo', handler: callRPG} // when user clicks "Go" do the "callRPG" function
]
});

panelMain.render(document.body); // render the main panel (like exfmt)

});

</script>

</head>
<body>
</body>
</html>

richard.milone
10-28-2008, 02:46 PM
Hey Captndjc,

This is a classic problem of the dreaded trailing comma. If there is a trailing comma somewhere at the end of an array or element list Internet Explorer will bomb. However, Firefox tolerates it. In this code:

showAnother
],
}],

the first comma is not required and is causing Internet Explorer to bomb. Simply removing that should make it work.

richard.milone
05-13-2009, 08:52 PM
Here's a trick I recently learned to turn on real-time checking for the trailing comma in Aptana:

In RDi, choose Window->Preferences. Then navigate to Aptana->Editors->JavaScript->Validation. Then check the "JSLint JavaScript Validator" box, and click OK.

Now trailing commas will show as a formatting error when you're editing your JavaScript. Very handy!