AJAX-GET
function ajax_get(url, callback) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
//console.log('responseText:' + xmlhttp.responseText);
try {
var data = JSON.parse(xmlhttp.responseText);
} catch (err) {
console.log(err.message + " in " + xmlhttp.responseText);
return;
}
callback(data);
}
};
xmlhttp.open("GET", url, false); //async tru , sybc false
xmlhttp.send();
}
ajax_get('@Url.Action("getDerslik")', function (result) {
derslik_select_options = result.data;
console.log("DERSLİK BİTTİ");
console.log(derslik_select_options);
console.log(parent_select_options);
});
