Alert Json object

后端 未结 4 1443
别那么骄傲
别那么骄傲 2021-02-02 07:43

I have the following json object i need to alert it through javascript.

{data:[{\"empmenuid\":\"1\",\"empid\":null,\"deptid\":\"66\",\"aliasid\"         


        
4条回答
  •  再見小時候
    2021-02-02 08:35

    You can access a JSON objects properties using the dot operator:

    var person {
       "name":"test",
       "age":20    
    }
    
    //document.write(person.name);
    alert(person.name);
    

提交回复
热议问题