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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:42:51+00:00 2026-06-06T15:42:51+00:00

I have an HTML5 application that manipulates the browser history to show the proper

  • 0

I have an HTML5 application that manipulates the browser history to show the proper URL for Ajax calls. This works great, but a problem occurs when my application has hyperlink to an external site, say http://www.google.com. When this happens, the history looks like this:

My App Page A -> My App Page B -> Google

When the user hits the back button once, everything is fine. My App Page B is shown.

But when the user hits the back button a second time, the URL changes, but the page doesn’t change. My app can’t make the proper Ajax call to show the state for My App Page A, because the onpopstate handler never got called. This is because the handler wasn’t initialized when the browser went back to My App Page B (no events fire on that back event, so I can’t reinitialize the handler.)

This experience is with Chrome, but I have no reason to believe it is Chrome-specific. Is there a way around this problem?

I know that applications like Gmail open all external hyperlinks in a new window. But the requirements for my application don’t allow me to do that.

  • 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-06T15:42:53+00:00Added an answer on June 6, 2026 at 3:42 pm

    The link provided by @Pumbaa80 put me on track to the right answer.

    If you put <body onunload=""> on your page, then is breaks the bfcache on Chrome and other browsers. This means that when you click the back button to return to My App Page B from Google, all page state JavaScript events will fire.

    There is no way to get onpopstate to get called on My App Page B after coming back from Google. (This woud be illogical, as that event only fires on the page where you hit the back button.)

    The alternative is to execute the logic when My App Page B loads. By breaking the bfcache as described above, jQuery dom ready will fire. By running similar code from onpopstate in a jQuery dom ready callback, I can access the data stored in the History object reset the state of my HTML5 web app after returning from an external page.

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

Sidebar

Related Questions

The Situation: I have a mobile, HTML5 application. The application works great in any
I have an HTML5 application that requires offline support. For running the application, I
I have built a one page web application that manipulates a set of data:
I have developed a small windows forms application in C#. This application simply manipulates
I have a web application that uses HTML5, javascript, and jquery to send messages
I have a doodle application that saves an html5 canvas to an image in
I have a data entry form in a HTML5 application that users will be
Can an HTML5 application that is running in a browser access native resources. The
I have an HTML5 application that allows users to drag-n-drop an image to a
I have an application that uses html5 to let the user listen to some

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.