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

267
Views
Enlace HTML: href si javascript está deshabilitado, haga clic en si js está habilitado

Para enviar a los usuarios a diferentes enlaces, utilizo una función JS que, cuando se llama, crea una animación, se agota un poco y luego ubica.href al usuario, el problema es que si un usuario no tiene habilitado JS, no estará redirigido al sitio. ¿Hay alguna forma de que al hacer clic redirija al usuario normalmente si no tiene JS habilitado y lo redirija con mi función si JS está habilitado?

¡Gracias de antemano!

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

0

Podría intentar crear el elemento con los atributos href y onclick. Luego, en su JS, establezca el atributo href en "javascript: void (0)".

El código sería algo como esto:

html

 <a id="jsElement" href="/newPage.html" onclick="callFunction()">Text</a>

javascript

 window.onload = function() { document.getElementById("jsElement").setAttribute("href", "javascript:void(0)"); }
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!