Doubts about ajax

Doubts about ajax

Hello everyone !

My name is Taniguchi am im new at jquery. im developing a jquery code to get latitude and longitude from bing map rest service, i already have the code but i have trouble to understand part of it.

function getcordinate(executionContext){
var attribute = executionContext.getEventSource();
var Rua = atribute.getvalue;
var bingURL = " http://dev.virtualearth.net/REST/v1/Locations/BR/query='" + Rua + "'&key=AlBxRwA5l41uHKOuC8_cNHwnAe8trlfDFqr5h-O7iz_jCPGaIuW4RhZZhMjOCj8C";
var finalURL = proxy + bingURL;

$.ajax({
type: 'GET',
url: finalURL,
success: function (data) {
debugger;
if (data.resourceSets[0].estimatedTotal > 0) {
var loc = data.resourceSets[0].resources[0].point.coordinates;
//$("#results").html('latitude:' + loc[0] + ', longitude:' + loc[1]);
Xrm.Page.getAttribute("crd4c_latitude").setValue( loc[0].toString() );
Xrm.Page.getAttribute("crd4c_longitude").setValue(loc[1].toString());
Xrm.Page.getControl("crd4c_latitude").setDisabled(true);
Xrm.Page.getControl("crd4c_longitude").setDisabled(true);
}
else {
alert("sorry that address cannot be found");
}
},
error: function (jqXHR, textStatus, errorThrown) {
debugger;
}
});
}

what the function(data) is doing ?