{"size": 986, "ext": "js", "max_stars_repo_path": "js/dropdown.js", "max_stars_repo_name": "pnuggz/dailysportboss-codeigniter", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "js/dropdown.js", "max_issues_repo_name": "pnuggz/dailysportboss-codeigniter", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/dropdown.js", "max_forks_repo_name": "pnuggz/dailysportboss-codeigniter", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.8064516129, "max_line_length": 104, "alphanum_fraction": 0.4574036511}
/**
 * Created by RIZZ-ASUS on 20/04/2016.
 */

$('#leagues_id).hide();
$('#sports_id').change(function(){
    var state_id = $('#sports_id').val();
    if (state_id != ""){
        var post_url = "/index.php/control_form/get_cities/" + sports_id;
        $.ajax({
            type: "POST",
            url: post_url,
            success: function(sports) //we're calling the response json array 'cities'
            {
                $('#leagues_id').empty();
                $('#leagues_id').show();
                $.each(sports,function(id,sport_name)
                {
                    var opt = $('<option />'); // here we're creating a new select option for each group
                    opt.val(id);
                    opt.text(sport_name);
                    $('#leagues_id').append(opt);
                });
            } //end success
        }); //end AJAX
    } else {
        $('#leagues_id').empty();
        $('#leagues_id').hide();
    }//end if
}); //end change
