|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Need Assistance with created a variable from queried data
Hello -Jeanmarie Richardson 05/29/08 11:47 A hey there,William Seiter 05/29/08 11:58 A Hi William,Jeanmarie Richardson 05/29/08 12:09 P could it be that you end up with a trailing comma after yourCharlie Griefer 05/29/08 12:13 P UPDATE --Jeanmarie Richardson 05/29/08 12:56 P to save multiple lines of code or 'formatted' code, you can use <cfsavecontent variable='[varname]'></cfsavecontent>William Seiter 05/29/08 01:17 P Hello - I am not sure how to approach this -- I have created a zip code radius search to locate stores accross the us. That part is working fine. I would like to take this a step further and plot these locations on a Google Map. I have have everything working great with Static data. I now need to migrate on piece of the code so that the data points are plotted dynamically. I need to create a variable from a the result of queried data. Not sure if an array would work here (not my strong point) In any case here is a snippet of code that I am working with. If this data was populated manually, it works perfect. When I try to do this by outputting a query I get no data. Thanks for you help. var markers = [ <cfoutput query="getlocations">{ 'abbr': 'A', 'name': '#firstname# #middleinit# #lastname#, #designation#', 'latitude':#lat#, 'longitude':#long#, 'wp':'http://www.mysite.com/locator/locate.cfm' }, </cfoutput> ]; hey there, I am not familiar with the var that gets sent to google for this, however I did see what may be an unintended syntax error. In this code, you don't have the closing single quote after the 'first, middle, last' names and then again before the 'designation'. I am assuming that google is receiving this information as an incorrect number of parameters. Hope this helps, William var markers = [ <cfoutput query="getlocations">{ 'abbr': 'A', 'name': ----- Excess quoted text cut - see Original Post for more ----- Hi William, Thanks. The closing quote is actually after designation. However my problem specfically is that I cannot get this to ourput the group of data. At best I only get one record. Thanks. could it be that you end up with a trailing comma after your <cfoutput> block executes? can you paste the generated code (view source in the browser) to http://www.nomorepasting.com or http://pastebin.com/ ? On Thu, May 29, 2008 at 9:07 AM, Jeanmarie Richardson <jeannie@tdai.net> wrote: > Hi William, > Thanks. The closing quote is actually after designation. However my problem specfically is that I cannot get this to ourput the group of data. At best I only get one record. > > Thanks. UPDATE -- I am getting the data to query properly now, but now what I need to do is set the whole thing as a single variable so that I can call it later in the code... should I simply put a cfset tag around it? to save multiple lines of code or 'formatted' code, you can use <cfsavecontent variable='[varname]'></cfsavecontent> > UPDATE -- > > I am getting the data to query properly now, but now what I need to do > is set the whole thing as a single variable so that I can call it > later in the code... should I simply put a cfset tag around it?
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||