0

I know my question is weird little bit but I need to know how can I convert the application/JSON to text/HTML it is a form submit which I want to learn to convert I will place the JSON code blow which I want to convert is there any auto tool online do tell me but guide manually is best here is the code below:

{"ValidateIdPwdRequest":{"onlineId": "sfsdfsdfds","pwd": "IBuGEeZDHahjcQRyN+LAUg==","source": "","channel": "","traceid": ""}}

So please anyone can teach me how can I convert this I know equal is transfer as colon and, as & but confused when colon curly bracket or comma curly brack comes in and my whole work goes wrong and whole goes wrong please explain and tell me how can I convert it properly.

jottbe
  • 4,228
  • 1
  • 15
  • 31
Ajmal khan jamro
  • 49
  • 1
  • 2
  • 6
  • Can u try this http://stackoverflow.com/questions/10269469/how-to-convert-json-to-string – Varun Sreedharan Aug 16 '16 at 06:58
  • 'app/json' is text format as like 'text/html'. btw, json string can convert(deserialize) to JavaScript's object model with JSON.parse("....") and sereialize as String with JSON.stringify(obj). If you want to present json string to html format, first parse, then print out with JS. – Yourim Yi Aug 16 '16 at 07:09

1 Answers1

0

use textContent and innerHTML.

function toHTML(text){
toHTML.ele=toHTML.ele||document.createElement("span");
toHTML.ele.textContent=text;
return toHTML.ele.innerHTML;
}
hanshenrik
  • 19,904
  • 4
  • 43
  • 89