Getting the value of a Javascript object with dot notation - Javascript Object

Javascript examples for Object:Object Property

Description

Getting the value of a Javascript object with dot notation

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){// w  ww.jav a 2s  . c  om
var MessageEvent = {
    ports: Array[0],
    data: {
        "event":"playProgress",
        "data":{
            "seconds":"1.419",
            "percent":"4.002",
            "duration":"17.8"
        }
    }
};
console.log(MessageEvent.data.data.percent);
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials