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 back button. I have implemented some actions on the dialog and need to close the dialog page after the actions are done.
I have tried with
$("#page").dialog("close");
and
$.mobile.pageContainer.pagecontainer("change","#previousPageId");
both haven't worked for me.
How can i trigger the back button on page dialog with javascript?
I am using jQuery mobile 1.4.3 and jQuery 1.11.1. Thanks for your answer and any comments are welcome.
This should work:
Reverse-option being true/false determines whet ever you are going backwards or forwards. True means back I think.
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
JavaScript