Questions tagged [pageshow]

an HTML5 event or a jQuery Mobile event relating to pages. The HTML5 event is triggered when a session history entry is being traversed to. The jQuery Mobile event is triggered on the toPage after animation completes.

an HTML5 event or a jQuery Mobile event relating to pages. The HTML5 event is triggered when a session history entry is being traversed to. The jQuery Mobile event is triggered on the toPage after animation completes.

18 questions
18
votes
3 answers

JavaScript - bfcache/pageshow event - event.persisted always set to false?

In a standard Java / SpringMVC / JSP / jQuery web-app, I'm trying to detect a "Back" (or history.go(-1)) event, in order to refresh (AJAX) a summary component/panel content when I return to a page (where we can change the backend data that is…
Eoin
  • 241
  • 1
  • 3
  • 8
10
votes
5 answers

When does PageTransitionEvent.persisted evaluate to true?

I'm trying to detect if my current page is loaded from cache or is a fresh copy. I have the onPageShow callback registered on my body tag. I can see it being triggered, but I cannot produce a circumstance where the event.persisted is actually…
SnelleJelle
  • 933
  • 5
  • 18
  • 35
7
votes
2 answers

How to prevent reloading of web page from cache while using mobile safari browser?

Mobile Safari uses a special caching mechanism Page Cache (here) which basically keeps the current page alive but hibernated when we navigate to another page. This way, it can immediately display the previous page in its latest state when user…
Bakhshi
  • 1,299
  • 16
  • 25
4
votes
2 answers

What is the difference between html pageshow and load events?

HTML5 has a pageshow event. In what instances does it work differently than the body's onload handler?
Ben McCann
  • 18,548
  • 25
  • 83
  • 101
3
votes
0 answers

pageshow and onpopstate not work in ios

When I click a button to submit something it will have a function to show a div $("body").append('
howard
  • 31
  • 1
3
votes
3 answers

jQuery Mobile Dialog on page load

Working on my first jQuery Mobile app. There is a localStorage value that must have a value throughout the application, so I tapped into the pageshow event to check this value: $(function () { $("div[data-role='page']").on("pageshow", function…
tjc59
  • 633
  • 8
  • 24
2
votes
0 answers

Safari version 14 pageshow - event.persisted always set to false

I'm trying to reload a page on safari if the user presses the browser back button and if the event is persisted. My code works on safai version 15.6. But when I try on safari version 14.1, it never enters the if block, which means the…
avocado
  • 97
  • 3
  • 10
2
votes
1 answer

pageshow's event listener on a React component not working properly

I have the following scenario where I need to run some "code" when entering a page for the first time or returning to it from another page. Safari's cache feature (https://webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/) is causing that,…
dNurb
  • 385
  • 2
  • 16
2
votes
1 answer

JQuery Mobile, redirecting by window.location prevents pageshow event

I have a JQuery Mobile application with many pages linked to each other. If I put a link on page A and set the href to page B, this script works fine: $(document).on('pageshow','#pageB',function(){ alert('hello!'); }); But if I put a button on…
themehrdad
  • 169
  • 4
  • 12
1
vote
0 answers

Why window.onpageshow not running in android default browser?

Currently i'm trying to check if user press back button when running my webpage. I'm using window.onpageshow to check the experience. It works well in chrome and also safari. My problem is window.onpageshow not working in Android default browser. Is…
lauwis
  • 323
  • 1
  • 4
  • 15
1
vote
1 answer

Missing PageShow event in Android 2.2

I have an issue i've been encountering with Android 2.2 and 2.3.3 avd/phone but not if i use intel atom image for avd. I'm using phonegap 2.3.0 and jqm 1.3.0. I'm missing a pageshow event on a page and my application gets broken meaning navigation…
0
votes
1 answer

html page is loaded from disk cache but event.persisted is false

I have this to my javascript file: window.addEventListener('pageshow', function(event) { if (event.persisted) { console.log('Page was loaded from cache.'); } }); but if i navigate to another link and then hit back button, my html page is…
christk
  • 834
  • 11
  • 23
0
votes
1 answer

jquery mobile pageshow function firing twice

I have a main page with two internal pages. Each time I attach events on each $(document).("pageshow","pageXXX",function(){ alert("This is a test") }) The alert gets fired twice on the main page, also, when I call the internal pages the custom…
0
votes
1 answer

in JQM pageshow works, pagebeforeshow doesn't

hi I have some jQuery Mobile and pageshow works fine (it's blip bugged but it works fine) like this: $(document).off('pageshow').on('pageshow', function () { console.log('it happened'); }); NB: I have had numerous (READ: weeks lost) problems…
user26676
  • 280
  • 3
  • 21
0
votes
1 answer

jquery image load function not being called properly

I am having the following issue in a mobile web application I am developing: In javascript, I have a Image() control and I have an event attached to the image control that should fire when the image gets loaded. Inside of the "pageshow" event for…
Obi Wan
  • 969
  • 11
  • 26
1
2