Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

json array in hidden field not coming

> encodeURIComponent(JSON.stringify({"name":"John"}))
> "%7B%22name%22%3A%22John%22%7D"



> var data = JSON.parse(decodeURIComponent(div.getAttribute("data-json")))
> console.log(data)
> Object {name: "John"}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #json #array #hidden #field #coming
ADD COMMENT
Topic
Name
2+2 =