stay on popup page until it closed?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • perhapscwk
    New Member
    • Sep 2007
    • 123

    stay on popup page until it closed?

    How to make when a pop up is open, we are not allow to switch to primary
    page until we close the popup page?

    thanks.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    this is in my opinion a great source for user annoyance. personally, I don't recommend it.

    Comment

    • perhapscwk
      New Member
      • Sep 2007
      • 123

      #3
      from main.html, startA function will popup a page and from popup page,
      it will return a value to main.htm and alert the variable aaa.

      However, we know that window.open and alert always start at the same time and hence we never capture the return from popup, so I make a
      prompt to stop the startA keep running so computer have time to capture
      the return values from popup.

      But how to make user keep focus on popup page until it close?
      otherwise, before they return value from popup, they can see the prompt
      and can start the alert immediately before value(aaa) to return.

      help.
      thanks.

      main.html
      Code:
       
      function startA() {
       
      window.open("popup.htm");
       
      check=prompt("process?");
       
      if (check) {
      alert(window.aaa);  //aaa is a variable return from popup page
      }
      popup.htm
      Code:
      window.opener.aaa="okok";

      }

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        To answer the original question, you could use showModalDialog (where supported) or create your own version using DHTML (a pseudo-popup). It could be done with normal pop-up windows, but it will be annoying as pointed out by Dormilich.

        Your main problem can easily be solved by using a button in the parent to alert the set value.

        Comment

        Working...