The iOS Safari doesnt\'t seem to trigger pageshow event in the following situation.
Lets say I have 3 pages
Try using:
window.onpageshow = function(event) { if (!event.persisted) { alert("hello"); } };
Persisted is false on initial page load, so you can check against it, and if it false, it is your first page load.