js带“.”的对象属性名怎么使用

问题:这样的json对象(event)

{
  "title": "title",
  "alert":"ding",
  "extras":{
  "yourKey": "yourValue",
    "cn.jpush.android.MSG_ID": "1691785879",
    "app": "com.thi.pushtest",
    "cn.jpush.android.ALERT": "ding",
    "cn.jpush.android.EXTRA": {},
    "cn.jpush.android.PUSH_ID": "1691785879",
    "cn.jpush.android.NOTIFICATION_ID": 1691785879,
    "cn.jpush.android.NOTIFICATION_TYPE": "0"
  }
}
中的"cn.jpush.android.ALERT"属性怎么使用?

用event.extras.
cn.jpush.android.ALERT是访问不到的。
正确方法:event.extras[
"cn.jpush.android.ALERT"]
posted @ 2018-09-27 01:49  oliverreal  阅读(1661)  评论(0)    收藏  举报