Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery mobile: how to close a pop up dialog page from code?

I am opening a pop-up dialog like-

<a href="routeEdit.php" data-role="button"  data-icon="gear" data-inline="true" data-theme="b" data-transition="pop" data-rel="dialog">Edit</a>

Now, from that page, calling a method submit().

How will i close the pop-up from submit() method- without redirecting to main page?

like image 522
Avisek Chakraborty Avatar asked Sep 26 '11 21:09

Avisek Chakraborty


People also ask

How do I close a popup in jQuery?

In this article, we will use jQuery Mobile Popup close() method to close an already opened popup. This method doesn't accept any parameter. Example: In the example below we will use Popup close() method to close the opened popup after 3000ms.

How do I add a close button to my pop up?

When you add a link or button to your popup it will work as a custom conversion link by default. If you instead need to add a close button all you need to do is to add “spu-close-popup” class attribute to any HTML element you want to act as the closing button.

How to open a popup in jQuery?

To create a popup, add the data-role="popup" attribute to a div with the popup contents. Then create a link with the href set to the id of the popup div, and add the attribute data-rel="popup" to tell the framework to open the popup when the link is tapped. A popup div has to be nested inside the same page as the link.


1 Answers

$('#myDialog').dialog('close');

Try above coding. It's working for me.

like image 63
PPShein Avatar answered Sep 18 '22 16:09

PPShein