$(document).ready(function () { var user_data; var selected_user_id; $.ajax({ type: "POST", url: "/api/get_network", data: JSON.stringify({"platform": platform.description}), contentType: 'application/json', success: get_network_success, error: ajax_error_handler }); function get_network_success(data) { if (data.status === 'OK') { if (((data.network === 'internal') || (data.network === 'dialin')) && (data.user_ids.length > 0)) { $('.reset_label_option').hide(); $('#reset_label_option_1_available').show(); $('#reset_label_option_2_unavailable').show(); $('#reset_button_option_1').prop("disabled", false); $('#reset_button_option_2').prop("disabled", true); } else if (data.network === 'no_network') { $('.reset_label_option').hide(); $('#reset_label_option_1_unavailable').show(); $('#reset_label_option_2_available').show(); $('#reset_button_option_1').prop("disabled", true); $('#reset_button_option_2').prop("disabled", false); } } else if (data.status === 'ERROR') { $('.reset_label_option').hide(); $('#reset_label_option_1_unavailable').show(); $('#reset_label_option_2_unavailable').show() $('#reset_button_option_1').prop("disabled", true); $('#reset_button_option_2').prop("disabled", true); } else { } } $('#reset_button_option_1').click(function (event) { window.location.href = "/reset_direct"; }); $('#reset_button_option_2').click(function (event) { window.location.href = "/reset_socket"; }); $('#reset_button_option_3').click(function (event) { window.location.href = "/reset_data"; }); });