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

151
Views
El código de seguimiento de clics activa un bucle infinito

Estoy usando un detector de eventos para rastrear los clics en ciertos enlaces. Los enlaces que me gustaría rastrear se colocan sobre las imágenes.

Estoy usando el siguiente código y todo funciona bien en Firefox, pero en Chrome, el código entra en un bucle infinito después de hacer clic 3 veces en la misma página.

 function trackComp(event) { var clickedElement = (window.event) ? window.event.srcElement : e.target; var elem = clickedElement; var ape = []; while (elem.tagName != "HTML" && elem.tagName != "IMG") { var tuple = { "e": elem, "pe": elem.style.pointerEvents }; ape.push(tuple); elem.style.pointerEvents = "none"; console.log("cordinates x"+ event.x + "coordinates Y = " + event.y); elem = document.elementFromPoint(event.x, event.y); console.log(elem); } // Check if element was found // Reset the pointer events while (ape.length > 0) { var tuple = ape.pop(); tuple.e.style.pointerEvents = tuple.pe; } }

¿Alguna idea sobre lo que está mal con este código?

Gracias

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