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

125
Vistas
Does navigator.geolocation.getCurrentPosition 'undo' javascript/html actions?

I'm not sure how to word this because I don't know exactly what's happening.

Context: I am requiring the user's location upon clicking a "Deposit" button. I use js to get their location via navigator.geolocation.getCurrentPosition(). To signal to the user we are actively checking, I want to change the text to "Please wait...".

Problem: After changing that text with javascript, all is good. UP UNTIL it gets to the location function call. Then it resets the button back to "Deposit", and only that button. All other changes on the page via js persist.

Question: What's happening underneath the hood? How do I get around this?

Relevant HTML:

<div class="custom-amt col-md-3">
   <%= submit_tag 'Deposit', class: "red-btn form-control new-deposit-btn", data: {disable_with: " Please wait..." } %>
</div>

Relevant JS:

debugger; // up until this point, button text stays as "Please wait..." which is desired behavior
navigator.geolocation.getCurrentPosition(accessAllowed, handleError); // as soon as this location function is called, button text is reverted.
about 4 years ago · Juan Pablo Isaza
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