How to print object data in javascript

Posted by rxzhang on Stack Overflow See other posts from Stack Overflow or by rxzhang
Published on 2010-12-23T04:33:54Z Indexed on 2010/12/23 4:54 UTC
Read the original article Hit count: 213

Filed under:
|

I have the following object data:

var response = {
    "response": {
        "numFound": 7945,
        "docs": [{
            "description": "target",
            "url": "target",
            "id": "269653",
            "score": 6.9186745
        },
        {
            "description": "Target Kent",
            "url": "Target_Kent",
            "id": "37275",
            "score": 4.3241715
        }]
    },
    "highlighting": {
        "269653": {
            "description": ["<em>target</em>"]
        },
        "37275": {
            "description": ["<em>Target</em> Kent"]
        }
    }
};

I can use response.response.docs[0].description to print out "target". But I don't know how to print out "<em>target</em>". Thanks.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about object