- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hi theop76211228,
actually I am sending this JSON to an API and value for the street field escaping with two backslash (one for ACM JavaScript and second for JSON which enables to transfer and store this value properly in original state). After API process the data, JSON is returned with the same address (as sent one) properly escaped but with just one backslash, therefore problem is coming up in JavaScript (I need one more backslash). I am unable to change business process, to force API to add one more backslash just for me and so on... I am trying to find solution on my side (ACM) and I am aware that is difficult, but it is just impossible that no one had this problem earlier
Example:
var jsonResponseFromAPI = getJSONResponseFromAPI("retrieveFunction",jsonId,credentials,null);
part["address_street"] = jsonResponseFromAPI.entry[count].input.address.street;
part["zip"] = jsonResponseFromAPI.entry[count].input.address.zip;
So in this code, "zip" will be undefined because previous (street) field will be cut at " character which is not escaped twice.
On of the quick solutions could be to initial JSON escape with three backslash before sending, so one will be returned (the missing one), but this is just crazy and address will be stored in API with character "\" which is wrong.
Regards,
Milan
Views
Replies
Total Likes