JSON within UI Action script ?

hpesata
Kilo Expert

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

3 REPLIES 3

cwilker10
Giga Expert

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


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()


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