[Thread Edited By Adobe]
/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here.
Go ahead and to it now: https://adobe.ly/3eDnB4v */
Actual Question:
Hi,
I've created a json object which I'm adding value like json.put(key, value).
While I add value which already contains " " then it add backslash before double quotes.
How can I remove it?
Thanks,
Himanshu
Solved! Go to Solution.
Views
Replies
Total Likes
Here is a good Stackoverflow thread that can help:
http://stackoverflow.com/questions/21036626/remove-backslashes-from-json-data-in-javascript
Java tried to escape your string as " " is part of your string not actual quotes which are used in start and end
so that when you output string u get same string else you wont
which json library u r using?
Views
Replies
Total Likes
{ "identity": { "name": "Test", "moduleType": "rwdHtmlPromoModule" }, "htmlInfo": { "htmlBlock": "<div class=\"promo-bleed\"> <div class=\"max-width-1200\"> <a href=\"http://localhost:4502/content/dam/dtv/teamsite/rwd/ent/movies/201602/Oscar_Ballot_2016.pdf\" target=\"_blank\"> <img src=\"/content/dam/dtv/teamsite/rwd/ent/movies/201602/sm_bnr__OSCAR_Ballot_Banner.jpg\" class=\"promo-image show-sm\"> <img src=\"/content/dam/dtv/teamsite/rwd/ent/movies/201602/md_bnr__OSCAR_Ballot_Banner.jpg\" class=\"promo-image show-md\"> <img src=\"/content/dam/dtv/teamsite/rwd/ent/movies/201602/lg_bnr__OSCAR_Ballot_Banner.jpg\" class=\"promo-image show-lg show-xl\"> </a> </div></div> </div></div>" } }
This is my json data. All I want is to remove backslash from here bcz it's breaking the anchor link, finally.
Views
Replies
Total Likes
Can you share a background of wht are u trying to do
Are u taking this data from servlet and putting it in its place use JS?
Views
Replies
Total Likes
Here is a good Stackoverflow thread that can help:
http://stackoverflow.com/questions/21036626/remove-backslashes-from-json-data-in-javascript