JQuery Mobile 1.3.0 を JQuery 1.9.1 で
JQuery Mobile 1.3.0 が公開され、JQuery 1.9.1 に対応しているとのことで、CDN を
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
という設定で試していたのですが、どうも表示されなくなってしまったので、思いつくところをいくつかあたっていました。
$('div.ui-page').live('swipeleft swiperight',function(event){ … }
スワイプを試していたので、このようなイベント処理を入れています。これを見直してみました。
$('div.ui-page').on('swipeleft swiperight',function(event){ … }
これで表示されるようになりました。
実はわたし、JQuery はこれまでほとんど利用してきていないので、たいした情報も持っていないのですが、Google 検索すると、JQuery 1.7 から .on() が追加されて、こちらの利用が推奨されています。.bind()、.live()、.delegate() が .on() に統合されたとのことです。.bind()、.live()、.delegate() も引き続き利用できるそうなのですが。
$(document).bind('mobileinit', function(){ … }
$(document).bind('pageinit', function(event) { … }
もあわせて以下のように変更してみました。
$(document).on('mobileinit', function(){ … }
$(document).on('pageinit', function(event) { … }
なお、jQuery Core 1.9 Upgrade Guide http://jquery.com/upgrade-guide/1.9/ によると、「.live() removed」とありました。