function generateYears() {
$.ajax({
type: "GET",
url: "getYears.do",
data: "",
dataType: "json",
contentType: "application/json",
success: function(msg) {
populateYearsToSelectBox(msg);
}
});
}
function populateYearsToSelectBox(msg) {
var options = $("#selectYear");
$.each(msg.dataCollecton, function(val, text) {
options.append(
$('<option></option>').val(text).html(text)
);
});
}