Catching 'Last Record' in Coldfusion for IE javascript bug

Posted by Simon Hume on Stack Overflow See other posts from Stack Overflow or by Simon Hume
Published on 2010-03-31T10:38:13Z Indexed on 2010/03/31 10:43 UTC
Read the original article Hit count: 370

I'm using ColdFusion to pull UK postcodes into an array for display on a Google Map. This happens dynamically from a SQL database, so the numbers can range from 1 to 100+

the script works great, however, in IE (groan) it decides to display one point way off line, over in California somewhere.

I fixed this issue in a previous webapp, this was due to the comma between each array item still being present at the end. Works fine in Firefox, Safari etc, but not IE.

But, that one was using a set 10 records, so was easy to fix.

I just need a little if statement to wrap around my comma to hide it when it hits the last record. I can't seem to get it right. Any tips/suggestions?

here is the line of code in question:

var address = [<cfloop query="getApplicant"><cfif getApplicant.dbHomePostCode GT ""><cfoutput>'#getApplicant.dbHomePostCode#',</cfoutput></cfif> </cfloop>];

Hopefully someone can help with this rather simple request. I'm just having a bad day at the office!

© Stack Overflow or respective owner

Related posts about coldfusion

Related posts about google-maps