Hello,
i start from a Websocket an asynchronous JS-Function.
How can i send the result back to the Websocket?
Thanks in advance and Greetings ... Peter
i start from a Websocket an asynchronous JS-Function.
B4X:
GoogleMapsGeocoder2 = function(address) {
var geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'address': address }, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
var CSV = "";
$.each(results, function(key, result) {
CSV += result.formatted_address + ";";
CSV += result.geometry.location + "\n";
});
// ? How to send CSV to the Websocket?
} else {
// ? How to send "No results found" to the Websocket?
}
} else {
// ? How to send "Geocode was not successful for the following reason: " + status to the Websocket?
}
});
};
How can i send the result back to the Websocket?
Thanks in advance and Greetings ... Peter