Hi all,

Suppose, i access the website(Main window), the site will load. Meantime,i want to open a new window (Child window -like a pop up) on the top of the main window. Now,the browser focus on the child window.In the mean time the main window will disable.

Please find below the following code. Its everything works fine. But, suppose the user enable the pop up blocker, the child window blocked. But my requirement is, the main window disable, the child window must open when the popup blocker turned on.

  function modalWin() {
        if (window.showModalDialog) {       window.showModalDialog("christmas.swf","name","dialogWidth:918px;dialogHeight:500px");
        } else {
        window.open('christmas.swf','name','height=500,width=918,toolbar=no,directories=no,status=no,linemenubar=no,scrollbars=no,resizable=no ,modal=yes');

<body onLoad="modalWin();">
  This is Test!!


Edited by Nick Evan: Fixed formatting

8 Years
Discussion Span
Last Post by gpmmuthu

You may use scripts like Facebox for a unblockable popup and use some JS for closing it when the page loads.
Note: Please use code-tag for codes.

Edited by mike_2000_17: Fixed formatting


Hi.... Thank you very much for your reply. In my understanding, suppose we using the link, its not a problem. I want to open a popup when the first page loads. Any comments? Some time i login this daniweb site, its loading some popup. I want like this... U seen?


This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.