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

1.7K
Vistas
google.maps.event.addDomListener() is deprecated, use the standard addEventListener() method instead : Google Place autocomplete Error

I am trying to add Google place auto suggest, I copied the code from the developer's website to try it out but got the error : google.maps.event.addDomListener() is deprecated, use the standard addEventListener() method instead. Also I am not getting any place suggestions.

https://developers.google.com/maps/documentation/javascript/places-autocomplete

google.maps.event.addDomListener(window, 'load', initializeAutocomplete);

i have also added script <script src="https://maps.googleapis.com/maps/api/jskey=api_key&libraries=places"></script>

I have implemented the same thing in one html it worked successfully, but when I used it on click button which opens a popup (form which has place-input), it gave me this error.

Note : I have also tried addEventListener but that's giving me an error : google.maps.event.addEventListener is not a function

Do you have any idea why I am getting this error, and how can I fix this?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As addDomListener() is deprecated, use the standard addEventListener() method instead, you can do so as follows:

window.addEventListener('load', initializeAutocomplete)

Replace in a similar fashion at all the required places.

google.maps.event.addDomListener(<OBJECT>,<EVENT>,<FUNCTION>); 

to

<OBJECT>.addEventListener(<EVENT>,<FUNCTION>);
about 4 years ago · Juan Pablo Isaza 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