Skip to content
Advertisement

How to access JSON Object key with colon in name [closed]

I need some guidance on how to access this key of a JSON object using Javascript: "yweather:forecast". I tried json.yweather:forecast but it throws an error.

{
    "yweather:forecast" : [
        {
            "@day":"Wed",
            "@date":"10 Jul 2013",
            "@low":"75"      
        }
    ]
}

Advertisement

Answer

In JavaScript:

jsonobject["yweather:forecast"]

User contributions licensed under: CC BY-SA
11 People found this is helpful
Advertisement