如何触发数据相关=“返回".使用JavaScript在JQuery Mobile 1.4.3中单击按钮? [英] How to trigger a data-rel="back" button in JQuery Mobile 1.4.3 with javascript?
问题描述
我正在使用页面小部件"通过data-dialog="true"
在jquery mobile中实现一个对话框,一切都很好,我也可以使用后退"按钮返回到上一页.我已经在对话框上实现了一些操作,完成这些操作后需要关闭对话框页面.
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.
我尝试过
$("#page").dialog("close");
和
$.mobile.pageContainer.pagecontainer("change","#previousPageId");
两者都没有为我工作.
如何使用javascript触发页面对话框上的后退按钮?
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?
我正在使用jQuery mobile 1.4.3和jQuery 1.11.1. 感谢您的回答,欢迎任何评论.
I am using jQuery mobile 1.4.3 and jQuery 1.11.1. Thanks for your answer and any comments are welcome.
推荐答案
对话框小部件从1.4开始不推荐使用,因此.dialog("close")
不再是有效函数.
Dialog widget is deprecated as of 1.4, hence, .dialog("close")
is no longer a valid function.
要返回上一页:
-
jQuery Mobile
jQuery Mobile
$.mobile.back();
JavaScript
JavaScript
window.history(-1)
这篇关于如何触发数据相关=“返回".使用JavaScript在JQuery Mobile 1.4.3中单击按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!