coldboxproxy returning escaped html

Since Luis didn't seem to care how I posted questions, and no one has answered yet, I'm moving my question from the forums. Hopefully, no one will mind the double post.

I have blown the better part of a day trying to figure this out. I'm converting an app to coldbox 2.6.4. I formerly used AjaxCFC, and have converted the code to properly pass the param structure via coldboxproxy.cfc.

Now whenever I get the data back, it's returned in escaped format, e.g.
"\n\t\t\t\t\t<p>38 orders in request.</p>\n\t\t\t\t\n\t\t\t\t\t<input type=\"checkbox\" class=\"DisplayTrans\" checked=\"checked\" id=\"ZON\" /><label for=\"ZON\">\n\t\t\t\t\t Zoning</label>\n\t\t\t\t\n\t\t\t\t\t<input type=\"checkbox\" class=\"DisplayTrans\" checked=\"checked\" id=\"WCR\" /><label for=\"WCR\">\n\t\t\t\t\t Water Certification </label>\n\t\t\t\t\n\t\t\t\t\t<input type=\"checkbox\" class=\"DisplayTrans\" checked=\"checked\" id=\"RFF\" /><label for=\"RFF\">\n\t\t\t\t\t Request For File </label>\n\t\t\t\t\n\t\t\t\t\t<input type=\"checkbox\" class=\"DisplayTrans\" checked=\"checked\" id=\"BCR\" /><label for=\"BCR\">\n\t\t\t\t\t Birth Certificate Request </label>\n\t\t\t\t\n\t\t\t\t\t<input type=\"checkbox\" class=\"DisplayTrans\" checked=\"checked\" id=\"ANF\" /><label for=\"ANF\">\n\t\t\t\t\t Assumed Name/Secretary of State Filing</label>\n\t\t\t\t\n\t\n\t\t\t<tr>\n\t\t\t\t<th class=\"DateCol\"></th>\n
... reported in firebug.

What's happening is that any time I try to insert the data into a DOM object via jquery, the table html elements disappear.

coldboxproxy.cfc code is
<cffunction name="getStartPage" output="false" access="remote" hint="" returnFormat="XXX">

      <cfargument name="params" type="string" required="true">

      <cfset var qry="" />

               <cfset arguments= DeserializeJSON(params)>

               <cfset arguments["Event"] = "query.getStartPage">

       <cfset qry=super.process(argumentCollection=arguments)>

       <cfreturn qry>

   </cffunction>

Just for completeness, Here's my jquery call. It's pretty straightforward.
var obj=$.JSON.encode(params);

var auth = new cbProxy();

var s=auth.getStartPage(obj);

I've tried all combinations in the CFC returnType and returnFormat parameter to no avail. The only other thing I can see in the difference between original and coldbox versions is that my original did a POST to AjaxCFC, but coldboxproxy.cfc is doing a GET. I don't think that it makes a difference as to how the data is returned, but I'm not sure of much around now....

One more thing--I have my query CFC set up as an event handler more as a convenience than anything--was having problems setting up models before. I'm making other coldboxproxy ajax calls to other event handlers I wrote from scratch with no problems.

Can anyone help?

Couple of questions for you, as I’m not sure what you’re trying to achieve.

  • If you’ve had this answered in the forum - let us know so we don’t keep answering :slight_smile:

  • Does you query return that HTML. If so I’d expect a JSON struct of a query instead so I’m a bit confused.

  • Have you tried calling the coldboxproxy.cfc directly in a browser with the arguments to see what you get?

  • John

John,

Thanks for getting back to me. No, no one answered on the forums, so there’s no duplication of effort.

I can see your confusion. In my crazed mindset, I was cutting and pasting different possibilities I was finding online. That’s why the variable was qry even though I WAS returning HTML.

I ended up rewriting the code (real MVC this time), really getting a query from that module and then called an event handler to generate the HTML. Things are basically working now. It was just strange that calling the same cfcs through coldbox and ajaxCFC gave different results.

Thanks,
bob

Cool - glad you got it working :slight_smile: I haven’t used ajaxCFC for a while but seem to remember it generated different JSON to the SerializeJSON function.