Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

419
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!