tags:

views:

80

answers:

1

my json object is {"value":"3:Low:2:Med","fieldName":"multiple_priority"}

here i am getting output as

                    3
                    low
                    2
                    med

but, i need the output as

3:low
2:med

how can i get it?

Thanks,

A: 

If 'value' always have the same structure, you can use this:

var a = {"value":"3:Low:2:Med","fieldName":"multiple_priority"};
eval("var b = " + a['value'].replace(/(.*):(.*):(.*):(.*)/, "{$1:'$2',$3:'$4'}"));
b[3]; // Low
b[2]; // Med
Topera