Coldfusion 8 - SerializeJSON - Outputting with a comment

岁酱吖の 提交于 2019-12-25 07:34:27

问题


I have a strange issue which has started happening with SerializeJSON, it's outputting the JSON with a comment at the beginning and I have no idea why. I've setup this test case:

<!--- initialize variables --->
<cfset records = QueryNew('') />

<!--- create property bean --->
<cfscript>
output = SerializeJSON(records);
</cfscript>

<cfdump var="#records#"> 
<cfdump var="#output#">

Which outputs:

//{"COLUMNS":[],"DATA":[]}

Is this familiar to anyone?

SOLVED

Found the issue. The cause was setting <cfset THIS.secureJSON = true> in my Application.cfc. Setting it to false resolved the issue.

来源:https://stackoverflow.com/questions/17146365/coldfusion-8-serializejson-outputting-with-a-comment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!