JSON within UI Action script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2014 06:14 AM
Hi!
I am creating an UI Action which calls a Ajax based function (via script include), which calls a scripted webservice via SOAPMessage.
I am creating a JSON object with the resopnse and return a JSON.decoded string to my UI Action script.
my question is how I can parse/use the JSON string in my UI Action script ?
the JSON and JSONParser script includes dont work in a UI Action script, altough I set the client callable flag.
Thanx in advance!
regards,
Hans

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2014 07:01 AM
You would want to use the
var json = new JSON();
return json.encode(retString);
in your server side code and then on your client side:
var value = answer.evalJSON();
-Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2014 07:26 AM
Not sure what evalJSON() does but JavaScript's eval() should better not be used as it open possible security holes.
You can use "JSON.parse(answer);" to avoid using eval()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2014 07:35 AM
Hi!
Thanx for the replies!
I was able to handle the JSON stuff on the server and the client side, but I couldnt manage to save the received attachments from the client browser. because of all the involved security issues, it doesnt seem to be possible to save a file to a local disk form a browser window.
regards,
Hans