javascript - How can I return a response from a call in order to open xml file using jquery

one text

Solution:

That is what Ajax does, the processed data will be handled in the success handler.
What you can do if you really want to is create another function where you can process your data.

    $(document).ready(function () {
        var open = null;
        $.ajax({
            type: "GET",
            url: "../build/js/openTickets.xml",
            dataType: "xml",
            success: nv = function (xml) {
                $(xml).find("mestickets").each(function () {
                    open = $(this).find("nbopenTickets").text();

                    openData(open);

                });
            }

        });

        function openData(open) {
            console.log(open);
        }
    });

Source