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

420
Visualizações
How to remove the url param after it was completed

I am trying to remove the url param after function was completed, so it won't break the uix.

Here how it looks if param is not removed
http://localhost:1337/check?domain=fb.com&success=task&success=note . I need it to look like this http://localhost:1337/check?domain=fb.com&success=task after every call. Will be glad for help

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

0

  1. Get the URL search query string by window.location.search and parse it with URLSearchParams.
  2. Use getAll(name) to get all values of the parameter as an array.
  3. Remove the desired element from the array.
  4. Edit it back in with set(name, value)
  5. Then use window.location to change the URL with toString()'s result (back as a string).
const searchParams = new URLSearchParams(window.location.search);
const success = searchParams.getAll('success')
success.pop(); // ['task']
searchParams.set('success', success);
window.location.search = searchParams.toString();
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