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

168
Views
JS get all URL parameters available for final form page

I see a lot of ways and a number of them seem overly complicated. i do plan on appending a program that will use these parameters to test based on the results.

But for now, I want a way to get all the URL parameters and post them using a p tag.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Does this answer your question? You can get the search params of a URL with the URL constructor and accessing the searchParams property.

const div = document.querySelector('div');

const appendParams = (url) => {
    const params = Object.fromEntries(new URL(url).searchParams.entries());

    for (const key in params) {
        const p = document.createElement('p');
        p.textContent = `${key}: ${params[key]}`;
        div.appendChild(p);
    }
};

window.addEventListener('DOMContentLoaded', () => {
    appendParams('https://hello.world?foo=bar&fizz=buzz&abc=123&hello=world');
});
<div></div>

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!