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 8598409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:08:39+00:00 2026-06-12T01:08:39+00:00

The issue I’ve found is very similar to this question , except that Safari

  • 0

The issue I’ve found is very similar to this question, except that Safari on desktops seems to have resolved the issue. Essentially, the issue is this: when a client is browsing on mobile safari and the page executes a javascript function on pageA.html, then navigate to pageB.html, then press the back button to go back to pageA.html, the javascript function won’t run when the client pressed the back button to come back to pageA.html. It will skip the javascript call.

I’ve tried the solutions mentioned in the link above, but nothing seems to work for mobile Safari. Has anyone else encountered this bug? How did you handle it?

  • 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-12T01:08:40+00:00Added an answer on June 12, 2026 at 1:08 am

    This is caused by back-forward cache. It is supposed to save complete state of page when user navigates away. When user navigates back with back button page can be loaded from cache very quickly. This is different from normal cache which only caches HTML code.

    When page is loaded for bfcache onload event wont be triggered. Instead you can check the persisted property of the onpageshow event. It is set to false on initial page load. When page is loaded from bfcache it is set to true.

    window.onpageshow = function(event) {
        if (event.persisted) {
            alert("From back / forward cache.");
        }
    };
    

    For some reason jQuery does not have this property in the event. You can find it from original event though.

    $(window).bind("pageshow", function(event) {
        if (event.originalEvent.persisted) {
          alert("From back / forward cache.");
        }
    });
    

    Quick solution to these problem is to reload the page when back button is pressed. This however nullifies any positive effect back / forward cache would give.

    window.onpageshow = function(event) {
        if (event.persisted) {
            window.location.reload() 
        }
    };
    

    As a sidenote, you can see lot of pages offering using empty onunload handler as solution. This has not worked since iOS5.

    $(window).bind("unload", function() { });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Issue is only with Safari: I have three tabs that each show a div
Issue is that I have wrote a method to duplicate selected row in a
Issue/Question : I'm using CodeIgniter to build an event calendar, and I have included
Issue is resolved now... I have a simple web form where i need to
The issue that prompted me to ask this is a web form that was
This issue is driving me mad. I have several tables defined, and CRUD stored
Issue is related to this and this . The problem is that when a
Issue is that I can't change a column type to 'Text' This is the
Issue: I have a markup like this (only the important lines): <%@ Control Language=C#
Issue adding on change event to a control. I currently have a page that

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.