My favorite idiom by which I live as a developer is, “It’s always the small things.” By which I mean that when there’s some catastrophic problem with my web page or software, I always scan for the little things first – missing semi-colons, syntax errors, reserved words as variables, etc. I’ve learned this from years and years of fruitlessly debugging an application for endless hours only to, in the end, find I didn’t close a tag, or left out a double quote.

Today I can add another “little thing” to the mental library.

I’m populating some Ext ComboBoxes with an array which is created by looping over a query.

Ext.mappingData.payers = [
	<cfloop query="allPayersQuery"><cfoutput>['#pr_seq_no#', '#identifier#'],</cfoutput></cfloop>
];

This worked perfectly fine in Firefox, as usual. However, a user who was testing my app in IE found that the ComboBoxes weren’t working. I spent my usual hours trying to figure out why it wouldn’t work in IE. I even spent another few hours recoding one page with a band-aid workaround. I ran across the problem tonight in another page, and it just popped into my head…. the trailing comma.

I rewrote my code to build the array and trim off the last comma and it finally worked in IE.

Hopefully this post will save someone hours of work in the future.

Powered by ScribeFire.