var json_obj = {
pos1:{x1:123, x2 :234, y1:222, y2:333},
pos2:{x1:999, x2: 888, y1:777, y2:666}
};
for (var p in json_obj) {
alert(json_obj[p].x1);
}
This method can also be extended, such as traversing the attributes in the object, functions in the object, etc.