Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {
- "alias": "Server1",
- "hostgroup_worst_service_state": "0",
- "status_history": {
- "status": [
- "0",
- "2",
- "0",
- "0"
- ]
- }
- },
- {
- "alias": "Server2",
- "hostgroup_worst_service_state": "0",
- "status_history": {
- "status": [
- "0",
- "0",
- "0",
- "0"
- ]
- }
- },
- {
- "alias": "Server3",
- "hostgroup_worst_service_state": "0",
- "status_history": {
- "status": [
- "1",
- "1",
- "1",
- "0"
- ]
- }
- }
- ]
- $.each(data, function(i, item) {
- console.log(item.alias)
- console.log(item.hostgroup_worst_service_state)
- }
- ["0","2","0","0"]
- ["0","0","0","0"]
- ["1","1","1","1"]
- $.each(data, function () {
- console.log(this.status_history.status);
- });
- $.each(data, function (i, item) {
- console.log(item.status_history.status);
- });
- var arr = $.map(data, function (el) {
- return [ el.status_history.status ];
- });
- var result = [];
- for(var i = 0; i < data.length; i++) {
- result.push(data[i].status_history.status);
- }
- for(i=0;i<data.length;i++)
- {
- console.log(data.status_history.status);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement