﻿$(function () {
    $.ajax({
        url: "js/travel/airports.xml",
        dataType: "xml",
        success: function (xmlResponse) {
            var data = $("airport", xmlResponse).map(function () {
                var myStr = $("name", this).text();
                myStr = myStr.split(":")[0];
                return {
                    value: myStr,
                    id: myStr,
                };
            }).get();
            $("#city1").autocomplete({
                source: data,
                minLength: 0
            });
            $("#crc2").autocomplete({
                source: data,
                minLength: 0
            });
        }
    });
});

