$('#selectTerritory').change(function(){ var selectTerritory= $(this).val(); $.ajax({ type : "POST", url: "registration.php", // beforesend:(presend()), data: {Territory:selectTerritory}, success: function (data) { $('#detale_sitis').html(data); } }); }); $('body').on('change', '#selectRayons',function () { var selectRayons = $(this).val(); $.ajax({ type: "POST", url: "registration.php", // beforesend:(presend()), data: {Rayons: selectRayons}, success: function (data) { $('#detale').html(data); } }); }); 

Such a problem: there is data received by the Ajax request. How to save and use them in a settled Ajax request?

Thank.

    1 answer 1

    Declare a variable before the request

    var selectTerritory;

    • one
      Perhaps the answer will even prove to be true, only in its current form it is completely inimitable and incomprehensible. Explain in detail (using the edit button), how will this help? - andreymal