title: Is there an alternative to async:false in Jquery?
body: <p>I am getting Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.
  I have looked into this post but couldnt find anything to suit my need. </p>
  
  <p><a href="https://stackoverflow.com/questions/22090764/alternative-to-async-false-ajax">alternative to async: false ajax</a></p>
  
  <pre><code>$(docucment).ready(function(){
  
  var obj=AppendFileList(10); 
   $.each(obj.Table, function (key, value) {
               //some code to do some task                                           
     });
  
  });
  
  
  
  
  function AppendFileList(lotid) {
  
                  $.ajax({
                      type: "POST",
                      url: "XYZ/GetAttachements",
                      data: JSON.stringify({ LotId: lotid, GUID: $('#hidnuniqueid').val() }), // LotId: arr1[1],
                      contentType: "application/json; charset=utf-8",
                      dataType: "json",
                      async: false,
                      success: function (data, status) {
                          var obj = jQuery.parseJSON(data.d);
                          console.log(obj);
                          return obj;
  
                      },
                      failure: function (data) {
                          console.log(data);
  
                      },
                      error: function (data) {
                          console.log(data);
                          console.log(data.Message);
                      }
                  });
  
              }
  </code></pre>
  
  <p>I do not want to keep ajax() method outside within a separate function as i have shown in my example so that I dont have to write ajax call again and again. Is this possible?</p>