Closed azn1viet closed 9 years ago
You want to use callbacks in a wrong way.
Try this code:
var dataCarrier;
function successCallback(result) {
alert(result);//give me [object][object]
alert(result['carrierName']);//give me 'Verizon'
dataCarrier = result['carrierName'];
}
function errorCallback(error) {
alert(error);
}
window.plugins.carrier.getCarrierInfo(successCallback, errorCallback);
thanks, it works.
dataCarrier gives null, only alert works. How can I get carrier name to a string as dataCarrier