Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

115
Vistas
Is there a way to run a function asynchronous with the rest of the page from inside of a jquery success function?

So I have a webpage that loads a list of content from a php server-side script, sorts it on the client side and adds the final list to a div in the webpage. When loading the page a button press pulls up the list something like

  searchRequest = $.ajax(
  {
        type: "GET",
        // blah blah blah 
        async: true,
        success: function(data)
        {
              sortTheData(data)
              addTheDataToThePage(data)


        }
  });

After a bit of testing I figured out that the jquery ajax request was working async as it was supposed to, but the page was still hanging during loading while sorting the list.

What I want to do is have the sorting and adding functions in the success function start at that point, but run without blocking the rest of the page from running smoothly (ie in its own thread, but still adding its results to the page at the end).

Ive tried running the sort & add parts in an async function, as well as wrapping it in a promise return, but the page still seems to hang whenever it reaches the sorting stage.

Do I need to use some sort of Web Worker to do this, or is there a way of doing it in pure javascript?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda