i have a string coming in like this
138374:order1,738437:order2,927438:order3
etc
I am doing a loop to split orders by comma (,)
but now how to I furthur split it to the order number and oredert name thats is separated by semicolo(:)
Below is the code
function(getOrders) {
var completeOrderRequest = getOrders.split(',');
for(var j=0; j < orderRequest.split(',').length; j++) {
alert(completeOrderRequest[j]);
var nameOrderIds = completeOrderRequest[j].split(':');
alert("OrderNumber: "+nameOrderIds[0]);
alert("Name : "+nameOrderIds[1]);
}
}
Right now its giving me orderNumber 0.
thanks