[Solved] Javascript ajax don’t work

[ad_1]

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();

[ad_2]

solved Javascript ajax don’t work