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?
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.
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.
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.
$('#myDialog').dialog('close');
Try above coding. It's working for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With