There is a way out, use complete. Use complete
instead of successsuccess
or donedone
:
posts = $.ajax({
type: 'GET',
url: ajaxurl,
async: false,
dataType: 'json',
data: { action : 'getHotelsList' },
complete: function(results) {
andAnd try to remove async:false
if the problem persists.