VaR JSON = '[{"Sb-after-sales service-001": [{"Sb-after-sales service-0020.a3": "pipeline planning "}, {"Sb-after-sales service-0020.a4": "confirm basic training plan with customer"}] },{ "Sb-after-sales service-002 ": [{"Sb-after-sales service-002_e1": "received customer payment"}] ';
JSON = eval ('+ JSON + ')');
For (var I in JSON)
{
For (var key in JSON [I])
{
VaR json2 = JSON [I] [Key]; // job Array
Alert (key );
For (var k in json2)
{
For (var key in json2 [k])
{
Alert (Key + "," + json2 [k] [Key]);
}
}
}
}
//// // The second complex method is shown below
VaR STR = '{"consumable sales process": {"count": 1, "processset": [{"worktodoset": [{"ID ": "HC-sales process-0020.g4", "name": "Sales Contract Signing"}], "ID": "HC-sales process-001", "name ": "consumable sales process"}], "ID": "bcjumveeeq7", "name": "consumable sales process"}, "consumable customer complaint handling process ": {"count": 1, "processset": [{"worktodoset": [{"ID": "SB-HC-Customer Complaint Handling-00366g2", "name ": "Fill in customer complaint Complaint Form"}], "ID": "SB-HC-Customer Complaint Handling-001", "name": "equipment consumables customer complaint handling process"}], "ID": "bfa7ffcc12e554336631de8dfc4871", "name": "process for handling device consumables customer complaints"}, "device sales process": {"count": 0, "processset ": [], "ID": "fjmkr9t5nst", "name": "device sales process"}, "device after-sales service process": {"count": 3, "processset ": [{"worktodoset": [{"ID": "Sb-after-sales service-0020.a3", "name": "pipeline planning"}, {"ID ": "Sb-after-sales service-0020.a4", "name": "confirm basic training plan with customer"}], "ID": "Sb-after-sales service-001 ", "name": "after-sales service process of Equipment" },{ "worktodoset": [{"ID": "Sb-after-sales service-002_e1", "name ": "Received customer payment"}], "ID": "Sb-after-sales service-002", "name": "after-sales service process of Equipment"}], "ID ": "bfa7ffcc12f13b23b38fa7cf0bcb54", "name": "device after-sales service process"}, "device procurement and installation process": {"count": 2, "processset ": [{"worktodoset": [{"ID": "mk-20120307001_A2", "name": "Technical Standard available"}], "ID": "mk-20120307001", "name ": "device procurement and installation process" },{ "worktodoset": [{"ID": "mk-20120306002_A2", "name": "provide technical standards"}], "ID ": "mk-20120306002", "name": "equipment procurement and installation process"}], "ID": "bfa7ffcc12f142a7e3ddae8ed90c87", "name ": "device procurement and installation process "}}';
VaR JSON = eval ('+ STR + ')');
For (var I in JSON)
{
Document. write (JSON [I]. name + "[" + JSON [I]. ID + "]" + "(" + JSON [I]. count + ")");
Document. Write ("</BR> ");
}