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

120
Views
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
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!