Let's say I receive some data from jQuery Ajax output.
var tags = call_ajax('order/get_data', 'user_id=' + $('#user_id').val());
Outputted string from PHP file something like this :
echo "Aldi:01|Andi:02|Martin:03";
So my question is, how to .split() that outputted string(tags) become JS array with format like :
var source: [
{'value' : 'Aldi', 'id' : '01'},
{'value' : 'Andi', 'id' : '02'},
{'value' : 'Martin', 'id' : '03'}
]
Thanks in advance!
call_ajaxdo? Does it return the response synchronously, or the request promise?