Solved

Populating javascript array from query

Posted on 2001-09-16
5
589 Views
Last Modified: 2013-12-16
I am developing a website in coldfusion and am pretty unfamiliar with javascript. I have also posted this question in the javascript area. I need to populate a javascript array with the following query. Could someone please help me figure this out.

<CFQUERY DATASOURCE="myDsn" NAME="myQueryName">
SELECT modelNum,partNum,defaultPrice,description
FROM components
</CFQUERY>


Thanks in advance

Doug

P.S God bless the U.S.A
0
Comment
Question by:DBrown
5 Comments
 
LVL 1

Expert Comment

by:deestuar
ID: 6487087
Hi,
I've done something simialr with ASP before not with coldfusion. But is a general methodology
Scan through a record set building up a string array
of all the values in the recordset.
Write it out in your javascript code.

0
 
LVL 9

Accepted Solution

by:
miron earned 100 total points
ID: 6487381
Make a struct in javascript, with mapping between recordset fields and the struct members. Instantiate an array of structs and assign values from recordset fields accordingly using dot separator to assign value to individual members of struct.
0
 

Expert Comment

by:CleanupPing
ID: 9281563
DBrown:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 34

Expert Comment

by:arbert
ID: 9552238
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Miron's Comment

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Arbert
EE Cleanup Volunteer
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server Generate Scripts Fails 5 36
VB.NET 2008 - SQL Timeout 9 24
T-SQL: New to using transactions 9 29
replace \ by - in select 4 21
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question