How to break a jquery variable dynamically based on condition
- by Adi
I have a jquery variable which has is showing the value in the console as ..
["INCOMING", 0, "INETCALL", 0, "ISD", 31.8, "LOCAL", 197.92, "STD", 73.2]
Now as per my need i have to break these values and make it like this
["INCOMING", 0],["INETCALL", 0],["ISD", 31.8],["LOCAL", 197.92],["STD", 73.2]
but these values i need to make in the required formate dynamically as this is received from
database.
Here is my ajax call to get the values from server side..
var dbdata="";
$(document).ready(function() {
$.ajax({
type: 'GET',
url: 'getPieChartdata',
async:false,
dataType: "text",
success: function(data) {
dbdata=JSON.parse(data);
}
});
console.log(dbdata);
});
Please guys help me .
Thanks in advance..