【问题标题】:create java script object within coldfusion query using createObject (google maps)使用 createObject(谷歌地图)在冷融合查询中创建 javascript 对象
【发布时间】:2011-07-11 15:55:31
【问题描述】:

我正在查询一个经纬度值的数据库,并希望以对象的形式返回数据。每个对象都应该有一个 stName(状态名称)和 stPoint(纬度和经度点的数组,应该为每条记录推入数组中。) 然后应该将整个对象推入数组 stateObj。

下面的代码似乎有语法错误:

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>

【问题讨论】:

    标签: javascript google-maps object coldfusion


    【解决方案1】:

    您可能想在 ColdFusion 中查看 ToScript()JSStringFormat()

    并使用您的基本调试技术,例如查看源代码......并与您的期望进行比较。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-02
      • 1970-01-01
      • 2012-05-28
      • 2013-05-16
      相关资源
      最近更新 更多