Jquery ajax freezes web page UI when large response

Hi, I need some help please,I am using jquery.ajax in requesting data to server


 $(function(){
   $.ajax({
        type: 'post',
        dataType: 'json',
        data: 'formdata'
        url: 'serverprocess.php',
       success: function(data){


  }

});

});


The problem is that when the data response almost 1mb the web page or the UI gets freeze or hang.Is the problem in my ajax or in my server script ?can you help me on this please how to solve this problem.

Thank you in advance.

Thank you in advance.

By default $.ajax has async set to true, so it shouldn’t be freezing anything if you’re using it exactly like this. It should continue normally and just wait for the request to come back, it doesn’t matter how long the php takes to respond. It sounds like the problem is somewhere else in your javascript.