开发者

create java script object within coldfusion query using createObject (google maps)

开发者 https://www.devze.com 2023-03-19 05:03 出处:网络
I am querying a database of latitude and longitude values and want to return the data in the form of objects. Each object should have a stName (state name) and stPoint(array of latitude and longitude

I am querying a database of latitude and longitude values and want to return the data in the form of objects. Each object should have a stName (state name) and stPoint(array of latitude and longitude points which should be pushed into the array for each record.) The entire object should then be pushed into the array stateObj.

There appears to be a syntax error in the code below:

var stateObj=[];
var stName;
var stPoints;


<cfoutput query="states" group="stateid">
var temp= Object.create{{stName:#states.stateid#},{ stPoints:[]}};

<cfoutput>var coordinates = new google.maps.LatLng(#states.latitude#, #states.longitude#);
stPoints.push(coordinates);
</cfoutput> 

stateObj.push(temp);开发者_开发百科
 </cfoutput>


You may want to check out ToScript() and JSStringFormat() in ColdFusion.

And use your basic debugging technique, like View Source.. and compare to what you expect.

0

精彩评论

暂无评论...
验证码 换一张
取 消