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

213
Vistas
How to prevent redirect with autoclick in javascript?

I have this issue where if I click do a manual click of a button using my mouse, the browser will load the next page with an iframe with the appropriate URL. However if I use an autoclick (like .click()) then it will load the next page then continue to redirect and load the iframe URL in the top frame.

I noticed that the manual click actually has chrome blocking the redirect while the autoclick does not have chrome blocking the redirect. How does chrome know if I clicked with my mouse vs using .click()? And is there a way to imitate the manual mouse click? Or to prevent the redirect using javascript? I was thinking trying to wait until the next page loads then doing preventDefault() or something like that.

Also worth noting that I don't own the website code. I'm working on a program that overlays on top of the site I'm on so I kind of have to work around changing html.

Edit: adding code for visual. first chunk is the website code im working with.

<a target="_self" href="iframeUrl">
   <img border="0" src="/imageURL">
</a>

Using $0.click() is what I'm doing but it keeps redirecting when I get to the next page.

about 4 years ago · Juan Pablo Isaza
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