Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8390037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:52:55+00:00 2026-06-09T18:52:55+00:00

I have the following JS to display the current user’s Zipcode in #zip :

  • 0

I have the following JS to display the current user’s Zipcode in #zip:

(function ($, geolocation) {
    if (geolocation) {
        geolocation.getCurrentPosition(function (position) {
            $.getJSON(
                "http://ws.geonames.org/findNearestAddressJSON?callback=?",
                {
                    lat : position.coords.latitude,
                    lng : position.coords.longitude
                },
                function (data) {
                    $(function () {
                        $('#zip').text(data.address.postalcode);
                    });
                }
            );
        });
    }
}(jQuery, navigator.geolocation));

I also have a JS function to reload the page:

$('.reload').click(function(){
    window.location.reload(true);
});

In Mobile Safari, these two functions work together well. If the user opens the webpage, it will load the user’s current zipcode. Then, if the user changes locations, the user can reload the page by tapping the botton. This works fine, except when <meta name="apple-mobile-web-app-capable" content="yes"> is present.

When it is present, this what happens:

  1. User taps the icon on their home screen
  2. Webpage opens, with the address bar hidden, as <meta name="apple-mobile-web-app-capable" content="yes"> does this
  3. Zipcode loads like it should
  4. User moves location, taps the reload button
  5. Page fails to show the zipcode, with no erros logged to the console

I’m really stuck on how to fix this, but if this helps at all, here’s a working example:

http://www.codekraken.com/testing/zipper/zip.html

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:52:56+00:00Added an answer on June 9, 2026 at 6:52 pm

    There is no reload in full-screen web apps (using apple-mobile-web-app-capable). However, when the user changes location, and then runs the app again, it will always load the page. It won’t fire the reload event, but it will fire the onload event – every time it runs.

    If the user leaves the app running and changes location, you’ll need a simple “find me again” function that simply reruns your code to find the current location and zipcode.

    Now – HERE is a catch! I’ve found that on iOS, the position is often cached, even if you tell it to only use a fresh location, so sometimes, you’ll get the old location. I created a workaround for this called getAccurateCurrentLocation() that uses a very similar interface. You can find the code at https://github.com/gwilson/getAccurateCurrentPosition – it’s very simple to drop in as a replacement to getCurrentPosition().

    That should do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following javascript: $('#ge-display').click(function (event) { window.open('/googleearth/ge-display.php','','scrollbars=yes,menubar=no,height=650,width=1000,resizable=yes,toolbar=yes,location=no,status=no'); event.stopPropagation(); return false; }); the
I have the following code: $(document).ready(function() { // Manage sidebar category display jQuery(#categories >
I have the following code to display the paragraph of a post, after the
I have the following code to display an image in imagebox using EmgucV: Capture
i have the following select box and want to sort it by display:none inlne
So I have the following CSS in place to display a horizontal navigation bar
I have the following number: 4.3 I'd like to display this number as 4,3
I have the following line of text that I need to display <ul><li>Complementary to
I have the following HTML where I need the LI elements to vertically display
I have the following unicode for a char: 0x023D2A How do I display it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.