function that executes Jquer.ajax to defined url and then launch handler function or return data recevied
var getRequest = function (dataToSend,url,handler) {
if(!dataToSend){
dataToSend = '';
}
$.ajax({
type: 'GET',
url: url,
data:dataToSend,
success: function(data) {
if(typeof handler == 'function'){
handler(data);
} else{
return data;
}
}
});
};