SSブログ

【Note】iPad の pagehide の厄介ごと - awkward "pagehide" in iPad [iOS]

今回は、試しに英語の文章も併記します。間違えていたらごめんなさい、教えてください。

I write contents by English jointly for trial in this time. If I'm wrong, please tell me by comment.

IPad Safari Mobile でページのアンロードを扱う方法については、以前記事にしました。

The other day I wrote an article about how to handle the "page unload" in "iPad Safari Mobile".

ページのアンロードを処理のトリガーにする Web システムを iPad に対応させたい場合は、pagehide イベントしか使えません。

Only "pagehide" event is usable to start some kind of processing in "page unload" in iPad.

しかしこの pagehide、iOS のバージョンによって発生条件が違ったりします。

However, outbreak condition of "pagehide" depends on iOS version.

例えば、複数のタブがあり、タブ A がアクティブでタブ B が非アクティブだとします。

Please imagine, there are 2 tabs, tab A is active and tab B is not.

ユーザーがタブ B を見ようとして、タブ B をタッチした瞬間に…

Then a user touches tab B to watch it, and an active tab is changed; ...

  • iOS 6 ではタブ A の pagehide が発生しません。
  • iOS 7 ではタブ A の pagehide が発生します。
  • "pagehide" of tab A does NOT occur in iOS 6.
  • "pagehide" of tab A occurs in iOS 7.

・・・なんてことに(あれ? 逆だったかな?)。

... awkward(It may be reverse ?)

他のイベントでも、バージョンや環境に依存して挙動が違うものがあるのかもしれませんが。

Similarly, there may be the event that a condition changes under the influence of a version or environment.

ページのアンロード系を処理のトリガーにするのは、やっぱり最初の考え方が間違っているんじゃないかなあ。

I think that it is wrong to start some kind of processing in "page unload".

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。