Forum Post: Re: JSON-encode() function

  • Thread starter Thread starter jmls
  • Start date Start date
Status
Not open for further replies.
J

jmls

Guest
yes, they are ;) On 20 October 2014 20:40, Peter Judge wrote: RE: JSON-encode() function Reply by Peter Judge In 11.0+ there are built-in classes for working with JSON (like JsonObject and JsonArray), that take care of making stuff JSON-compliant. I do not know whether these classes are available in SpeedScript, though. -- peter From: ssouthwe [mailto:bounce-ssouthwe@community.progress.com] Sent: Monday, 20 October, 2014 15:18 To: TU.OE.Development@community.progress.com Subject: [Technical Users - OE Development] JSON-encode() function JSON-encode() function Thread created by ssouthwe Now and then in WebSpeed, we find it convenient to output the value of ABL variables or fields into JavaScript. For example: The problem with the above is that if customer.name contains an apostrophe or backslash, you could have problems with the way that JavaScript will interpret it. Backslash is a control character PHP language has a function called JSON-Encode() that will just return the JSON representation of a variable. I know ABL has some ways to turn temp-tables or datasets into JSON, but is there a simple way to do this with the ABL for a character variable? e.g.: I have rolled my own types of functions for this over the years, but just wondered if there was a better way. Stop receiving emails on this subject. Flag this post as spam/abuse. Stop receiving emails on this subject. Flag this post as spam/abuse. -- Julian Lyndon-Smith IT Director, dot.r http://www.dotr.com

Continue reading...
 
Status
Not open for further replies.
Back
Top