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

124
Vistas
How to have a link trigger both a file download and take me to a new page?

I am trying to set up my website to download a file when a user clicks a specific link and then also take them to a separate page. From what I have gathered, this is not possible using pure HTML since we can't chain A tags together. Is this understanding correct? If so, how would I approach doing this in Javascript?

For context, I am trying to mimic the behavior on this site: https://code.visualstudio.com/download when you click the download VS Code button.

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

I can think of two ways to do this.

  1. You can handle all that in an event listener function for the download button to open a new location and also open a file link (to trigger download).

  2. You can handle it that an event listener opens a new link then triggers download with window.onload or window.contentLoaded.

about 4 years ago · Santiago Gelvez 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