Javascript examples for JSon:JSon String
Access Json object from property.property format
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w . j a va2 s .c om*/ var str = '{"channels": [ {"name": "video1","image": "images/bodyguard.jpg"}, {"name": "video2","image": "images/bodyguard.jpg"}, {"name": "video3","image": "images/bodyguard.jpg"}]}'; var obj = JSON.parse(str); console.log(obj.channels.length); } </script> </head> <body> </body> </html>