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

75
Views
src.match se considera nulo a pesar de estar definido?

Tengo un problema, no entiendo por qué este src.match se considera inválido

 PUG (HTML) .mainSplitContainer.mainRectangleContainerReverse .splitContainer.column8 .responsiveTextTitle.highlightText.rectangleContainer | RESPONSIVE ECONOMY .responsiveText.responsiveText |With its flux econonomy system, get an economy that responds to your actions instantly and requires you to adapt to the changes in the battlefield! .splitContainer.column4 .splitItem.rectangleItem //what actually matters from the html .splitImage#rectangleEconomy img(src='../img/resources.jpg' alt='') Javascript let ecoPicture = document.getElementById("rectangleEconomy"); setInterval(changeImage, 10000); function changeImage() { if (ecoPicture.src.match("resources")) { console.log("yesyesyes"); } else { console.log("nonono"); } }

No sé por qué devuelve este error.

TypeError no capturado: no se pueden leer las propiedades de nulo (leyendo 'src')

¿No es nulo porque #rectangleEconomy está definido? ¿Cómo resolver este problema? Sí, mi script está debajo de todo el HTML en changeImage (index.js:242:18)

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!