JSON - Access field named '*' asterisk

前端 未结 4 2186
南笙
南笙 2020-12-17 23:27

I am trying to access a field in a json object in javascript which has the key \'*\'. The jsonstring looks like this:

{\"parse\":
 {\"text\":
  {\"*\":\"text         


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 00:00

    Try use the index operator on parse.text:

    var value = object.parse.text["*"];
    

提交回复
热议问题