Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
Ajax async call for new window

today I am stacked with some question about async work of jquery ajax.I am pretty new to js and especially for jquery.

After click on button new tab opened and filled with pretty long request(a lot of data returned) and freeze other part of site (tab wi button) until request is done. Is there any possibilitty to make it work async, so my old tab will work while request computating?

Current js code for open new window

window.open(request, '_blank')

Which one obviously not async

May be something like

Var O = window.open() ; O. Ajax(blablabla)

UPD:

I solved problem by creating new element with rel="norefferer" and imitate click on that element, so new tab will open in new process and don't block main tab

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

AJAX is async (it literally means "asynchronous JavaScript and XML").

You just need to use it properly, as follow :

$.ajax({
    url: "https://www.example.com",
    "success": function(result) {
        // This part will be called after the ajax request was successful
        /* 
        insert your code here, 
        but be aware that, as CBroe noted in the comments, 
        window.open() could be blocked by modern browser 
        */
    }
 });

Read the jquery documentation on AJAX for more info.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda