最近jQueryMobileを使う機会があり、つまづいたのでメモ。 jQueryMobileは1つのHTMLの中にrole属性を持ったdivを作成してあげることで、それらをページとして扱うことができるようになります。 ページ切り替えのアニメーションなんかもつけられるので 「おおっ!こりゃ便利!」 と余裕こいていたら、結局色々いじらなければならず… 色んな問題も後から後から…泣 まあそれは違う機会に書こうかなと思います… 今回はページ切り替え終わった時にイベントを起こす方法です。 jQueryMobileは先ほど書いたようにページ自体は一枚のHTMLなので、 コンテンツを切り替えた際にloadイベントを起こす ってことが出来なかったのです‥ それで遷移した際にJavascriptを実行するpageshowイベント なるものがあることを知りました。 $('[data-role="