How to trigger a data-rel=“back” button in JQuery Mobile 1.4.3 with javascript?

后端 未结 2 1802
误落风尘
误落风尘 2021-01-15 09:50

I am using \"page widget\" to implement a dialog in jquery mobile with data-dialog=\"true\", everything is fine, i can also back to the previous page with the b

相关标签:
2条回答
  • 2021-01-15 10:08

    Dialog widget is deprecated as of 1.4, hence, .dialog("close") is no longer a valid function.

    To go back to previous page:

    • jQuery Mobile

      $.mobile.back();
      
    • JavaScript

      window.history(-1)
      
    0 讨论(0)
  • 2021-01-15 10:14

    This should work:

    $(':mobile-pagecontainer').pagecontainer('change', <pageid>, { reverse: false });
    

    Reverse-option being true/false determines whet ever you are going backwards or forwards. True means back I think.

    0 讨论(0)
提交回复
热议问题