JSON文字列の形式でオブジェクトを返すjQuery httpリクエストがあります。ここで私がしなければならないことは、JSON を jQuery オブジェクトに変換し、値を html 要素に割り当てることです...以下は、変換されるオブジェクトの構造です:
var Userrights = {
Id: // an id element
ScreenRights: // this is a list with following elements
{
ScreenName:
Create:
Read:
Update:
Delete:
Approve:
Access:
Print:
Email:
};
};
次のような JSON 文字列を受け取ると、次のようになります。
{
"Id": "Manager",
"ScreenRights": [{
"ScreenName": "CustomerScreen",
"Create": true,
"Read": false,
"Update": true,
"Delete": false,
"Approve": true,
"Access": true,
"Print": true,
"Email": true
},
{
"ScreenName": "TraderScreen",
"Create": true,
"Read": false,
"Update": true,
"Delete": false,
"Approve": true,
"Access": true,
"Print": true,
"Email": true
},
{
"ScreenName": "DistributorScreen",
"Create": true,
"Read": false,
"Update": true,
"Delete": false,
"Approve": true,
"Access": true,
"Print": true,
"Email": true
}]
}
この文字列を上記のオブジェクト構造にどのように変換しますか?