[Solved] Javascript ajax don’t work


First callback is not defined and second you also need to call get_lan() function to get it work

Updated code

function get_lan() {
    var lan_code = document.getElementById('customDropdown1').value;
    var params = "lan=" + lan_code;
    $.ajax({
        type: "POST",
        url: "api/get_lan.php",
        data: params,
        success: function(result) {
            document.getElementById("lan_code").innerHTML = result;
        }
    });
}

get_lan();

solved Javascript ajax don’t work