Skip to content

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"      
        }
    ]
}

Answer

In JavaScript:

jsonobject["yweather:forecast"]