Answers for "traccar attributes list"

1

traccar attributes list

function getCommandTypes(id) {

    $.ajax({
        type : "GET",
        url : sessionStorage.getItem('url') + "commands/types/",
        cache: false,    
        data:{deviceId:id},
        contentType: "application/json",    
        headers: {
            "Authorization": "Basic " + btoa(sessionStorage.getItem('email')+":"+sessionStorage.getItem('password')),
            "Accept":"application/json"
        },
        error: function (response) {        
            switch(response.status) {            
                case 400:
                    doOpenAlertError($.i18n("message_user_not_permission"));
                    break;
                case 401:
                    doOpenAlertError($.i18n("message_user_unauthorized"));
                    break;    
                case 404:
                    doOpenAlertError($.i18n("message_user_no_matching"));
                    break;            
                 default:
                    doOpenAlertError($.i18n("message_error_performing"));
                    break;
            }
        },
        success: function (response) {                        

            limpaSelect("type");

            $.each( response, function( key, value ) {      
                insertOption("type", value.type,$.i18n("title_" + value.type));              
            });

        }
    });        

}
Posted by: Guest on February-03-2021

Code answers related to "traccar attributes list"

Code answers related to "Javascript"

Browse Popular Code Answers by Language