Hello, I need a window.showModalDialog equivalent to open as modal and wait for it to continue the font, when I open it it becomes asynchronous from my site and does not work together.
ps window.showModalDialog works in IE
Hello, I need a window.showModalDialog equivalent to open as modal and wait for it to continue the font, when I open it it becomes asynchronous from my site and does not work together.
ps window.showModalDialog works in IE
Hello, according to the Mozilla documentation this feature is already deprecated and has been removed from Chrome and Firefox.
You can now use the <dialog>
tag.
Excerpt taken from the documentation itself
HTML
<!-- Simple pop-up dialog box, containing a form -->
<dialog open id="favDialog">
<form method="dialog">
<section>
<p><label for="favAnimal">Favorite animal:</label>
<select id="favAnimal">
<option></option>
<option>Brine shrimp</option>
<option>Red panda</option>
<option>Spider monkey</option>
</select></p>
</section>
<menu>
<button id="cancel" type="reset">Cancel</button>
<button type="submit">Confirm</button>
</menu>
</form>
</dialog>
<menu>
<button id="updateDetails">Update details</button>
</menu>
JS
(function() {
var updateButton = document.getElementById('updateDetails');
var cancelButton = document.getElementById('cancel');
var favDialog = document.getElementById('favDialog');
// Update button opens a modal dialog
updateButton.addEventListener('click', function() {
favDialog.showModal();
});
// Form cancel button closes the dialog box
cancelButton.addEventListener('click', function() {
favDialog.close();
});
})();