Sometimes we need to show Modal window in our web application. This window basically opens a popup window which does not allow the user to click any link in the background. User will be able to click on the background when he/she closes the window. The code snippet is given below:
-
<html>
-
<body>
-
<script language=“JavaScript”> function openWindow()
-
{
-
var myArguments = ‘nothing’; window.showModalDialog(”http://www.google.com”, myArguments, ”);
-
}
-
</script>
-
</html>
No related posts.
You can subscribe by e-mail to receive news updates and breaking stories.
Is “window.showModalDialog” browser-neutral?
The window.showModalDialog feature was not added to Firefox until version 3.0 https://developer.mozilla.org/en/DOM/window.showModalDialog
so it won’t work if you use this javascript in old browser. I don’t have any idea if it works or not in Chrome? Any idea Badotz?