Advertisement
arsta

Converting a JSON Text to a JavaScript Object

Oct 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.56 KB | None | 0 0
  1. Converting a JSON Text to a JavaScript Object
  2.  
  3. A common use of JSON is to read data from a web server, and display the data in a web page.
  4. For simplicity, this can be demonstrated using a string as input.
  5. First, create a JavaScript string containing JSON syntax like this:
  6.  
  7. var text = '{ "employees" : [' +
  8. '{ "firstName":"John" , "lastName":"Doe" },' +
  9. '{ "firstName":"Anna" , "lastName":"Smith" },' +
  10. '{ "firstName":"Peter" , "lastName":"Jones" } ]}';
  11.  
  12. save it "domo" for example
  13. =============
  14. To download the full prog to convert : http://infopade.com/4pyu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement