-4

以下是从文本文件中读取并存储在变量中的 json 元素。IE

sCurrentLine = {
    "description": "Update gclient to handle when a DEPS file has no deps dictionary.\n\nCommitted: http://src.chromium.org/viewvc/chrome?view=rev&revision=1652",
    "cc": [],
    "reviewers": [
        "nils.juenemann@gmail.com"
    ],
    "owner_email": "sguireknight@gmail.com",
    "private": false,
    "base_url": "svn://chrome-svn.corp.google.com/chrome/trunk/depot_tools/",
    "owner": "sguireknight",
    "subject": "Handle when a DEPS file has no deps dictionary.",
    "created": "2008-09-02 20:11:04.145884",
    "patchsets": [
        1
    ],
    "modified": "2011-05-09 13:10:20.276741",
    "closed": true,
    "commit": false,
    "issue": 201
}

我想访问问题值 201。我该怎么做?

4

2 回答 2

1

如果您使用的是 Javascript(您没有指定),您可以通过执行以下操作来访问该值:

sCurrentLine.issue

而已。

于 2013-06-03T17:28:56.093 回答
0

只是为了完整起见,还有另一种在javascript中访问它的方法

sCurrentLine["issue"]
于 2013-06-03T17:32:00.180 回答