Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7861335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:40:45+00:00 2026-06-02T22:40:45+00:00

When I use JQuery ajax function and the response is quite large ~1mb the

  • 0

When I use JQuery ajax function and the response is quite large ~1mb the ui gets frozen just before the success function is called. I have experienced this with the JSON.parse function and parsing a large amount of data. I believe that this function is used on the return of the request to format the content into JSON. Here is the code I am using.

$.ajax({
        url: "/sessions/" + this.get("session_id") + "/get_sample_data",
        data: params,
        dataType: 'json',
        type: "GET",
        success: function (response) {
            success(response);
        }
    });

Is there anyway to override the code for the response so I can stagger the parsing into parts and hopefully minimise the blocking on the ui? or is there another way to fix this. I am using chrome and chrome canary and I get the same result in both.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:40:47+00:00Added an answer on June 2, 2026 at 10:40 pm

    The guess is that parsing a giant JSON response is what it causing the delay. If that’s the case, then you have these options:

    1. Break up the server response into multiple requests.
    2. Break up the parsing into multiple pieces.
    3. Send the response off to a web worker and parse it in a web worker (doesn’t work in older browsers).

    To break up the parsing into multiple pieces, you would have to change the jQuery ajax call to just return the raw text and you’d have to create your own JSON parser that could do the work in chunks on setTimeout() so that the UI could stay alive while parsing. This would be a reaonable amount of work. I assume you’d start with an existing JSON parser and then you’d have to modify it to save it’s state in a way that it could work in chunks.

    Changing the interface to the server to retrieve pieces of JSON is probably the easier way to solve the problem if you can modify the interface to the server appropriately.

    For some alternative ideas on how to process large data in chunks, you can see Best way to iterate over an array without blocking the UI

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When i use jquery's $.post ajax function, page freezes for 2-3 seconds and then
I have an asp.net user control on which I want to use jquery ajax.
I use jquery ajax method, set datatype json, I get a jsonp response from
My question is about an error I have when I use jQuery.ajax in my
I have an ajax function using jQuery that defines an error function to be
I would like to have a function that returns the repsonseText of a jQuery.ajax()
I want to use jQuery function to fetch web service response but getting error
Where does the jquery ajax success callback return to? I have written a request
I'm trying to use jquery.Ajax to post data to an ASP.NET MVC2 action method
Assume we use jQuery.ajax() to POST data with two parameters, game_id and player_id .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.