1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

jQuery Mobileで$mobile.ajax(Forms|Links)Enabledが廃止されたらしい

1
Posted at

jQueryMobileを使用すると、Ajaxによるページ遷移が有効になります。カッコいいのかもじれませんが個人的にはこの上品ぶった感じのページ遷移方法が嫌いで、無効にしたいと思いました。サーバープログラムの動作にも影響を与えることがありますし。

で、よくある設定例は、だいたい以下の通り。

config.js
jQuery(document).bind("mobileinit", function(){
    jQuery.mobile.ajaxLinksEnabled = false;
    jQuery.mobile.ajaxFormsEnabled = false;
});

ここで作成したconfig.jsを、jQueryMobileと一緒に読み込むようにすればOKです。

・・・の、はずなのですが、これをしてもAjaxのページ遷移が有効になってしまう。なんでだろう?

と、調べてみると、ajaxLinksEnabledとajaxFormsEnabledは廃止されたようです。

というわけで、こうするのが正解。

config.js
jQuery(document).bind("mobileinit", function(){
    jQuery.mobile.ajaxEnabled = false;
});

これでAjaxページ遷移が無効になります。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?