IE7 problem when using popups

Discussion in 'Web Design, HTML And CSS' started by alejandro, Mar 12, 2007.

  1. alejandro

    alejandro New Member

    Joined:
    Mar 12, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hey everyone, I'm currently working on a php project that started about 3 years ago (meaning, it's already quite large.).

    It uses quite a lot of pupups that seem to work great in all browsers... or used to until IE 7 came along.

    The problem is, if I have a link that generates a popup but also relocates the page where the link was clicked, the main page will come on top of the popup when it starts loading (this does not occur in any other browser other than IE 7.). This occurs if the page has an onload event that sets focus somewhere in the page.

    I will provide an over-simplified example, try it out in FF, IE 6, and IE 7 to see what I mean:
    Code:
    <html>
      <head>
        <script language='javascript'>
          window.onload = function (){ window.document.getElementById('inputThing').focus  (); };
          function popup(){
            var newWindow = window.open('popup.html','','width=200,height=200'  );
            newWindow.focus(); // This will execute, but afterwards the window that executes
                               // it will reload and come on top of the popup window
          }
        </script>
      </head>
      <body>
        <a href='popup.html' onclick="popup();">Click Me</a>
        <input id='inputThing' type='text'></input>
      </body>
    </html>
    
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice