使用jquery的JSON循环

ped*_*sss 2 jquery json loops

在这里阅读了一些问题后,我仍然难以通过我的JSON结果循环.他们来了:

{
    "data": {
        "posts": [
            {
            "Post": {
                "id": "1",
                "user_id": "1",
                "title": "Test Content",
                "created": "2011-06-30"
                }
            },
            {
                "Post": {
                "id": "2",
                "user_id": "2",
                "title": "New Test Content",
                "created": "2011-06-30"
                }
            }
        ]
    }
}
Run Code Online (Sandbox Code Playgroud)

如何使用$ .each()获取Post.title?

The*_*ter 6

$.each(jsonObject.data.posts, function(index, val){
    alert(val.Post.title); //Do what you want to the title
});
Run Code Online (Sandbox Code Playgroud)