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

198
Views
Devoluciones de autocompletado de Google Places indefinidas

Tengo este código de fragmento de autocompletar que cuando el usuario hace clic en la sugerencia de autocompletar (que es el primer campo de entrada), los otros campos tendrán su valor agregado en función de la variable de lugar. Sin embargo, no sé por qué regresa como indefinido. Cualquier orientación sería útil. Gracias.

 let autocomplete; let placeSearch; let componentForm = { street_number: 'short_name', route: 'long_name', locality: 'long_name', administrative_area_level_2: 'long_name', country: 'long_name', postal_code: 'short_name' }; function initAutocomplete(){ if ( jQuery( '#autocomplete-streetNumber' ).length ) { autocomplete = new google.maps.places.Autocomplete( document.getElementById( 'autocomplete-streetNumber' ), { types: ['address'], componentRestrictions: {'country':['AU']}, fields: ["address_components"] } ); autocomplete.addListener( 'place_changed', fillInAddress ); } }; function fillInAddress() { // Get the place details from the autocomplete object. let place = autocomplete.getPlace(); // Get each component of the address from the place details // and fill the corresponding field on the form. document.getElementById('autocomplete-streetNumber').value = place.address_components.street_number; document.getElementById('streetName').value = place.address_components.route; document.getElementById('suburb').value = place.address_components.locality; document.getElementById('postCode').value = place.address_components.postal_Code; }
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!