Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

198
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda