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

197
Views
Load a page with onclick method of an html button with parameters in the url

I'm modifying a webpage and I would like to create a button that onclick it loads me a new page in the same window. For example, for a link to a webpage with some parameters it could be:

<a href="www.mypage.com/page?param1=abc&param2=345">LINK TO THE WEBSITE</a>

If I do this, the link loads correctly the website. If I modify it to:

<a href=javascript:window.open("www.mypage.com/page?param1=abc&param2=345", "_self")>LINK TO THE WEBSITE</a>

I'm successful too. However, I would like to implement this on a button. Therefore I have:

<button
   onclick="javascript:window.open('www.mypage.com/page?param1=abc&param2=345', '_self')"
</button>

However, now it loads "www.mypage.com/page", and the parameters are erased, even I can see in the source code of the website they are there. Why? How can I implement this with a button?

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

0

you could wrap the button into the href link.

for example:

<a href=javascript:window.open("www.mypage.com/page?param1=abc&param2=345", "_self")><button>Click me</button></a>
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!