Introduction: window.open()

window.open method opens a new window by using javascript. But if your browser has a popup blocker, then it may not work well. I have createed a demo on the question that has been asked on Stackoverflow.

 Demo

using blur

<--- it works in FireFox

using focus

<--- it works in FireFox

using focus with opener

<--- it works in FireFox
<script type="text/javascript">
        //blur, works both in IE and FF
        function newwindow_blur() {
            var myChild = window.open('child.htm', '', 'width=200,height=100,resizable=no');
            myChild.blur();
        }

        //focus, this doesnot work well in IE8 well, however works in FF
        function newwindow_focus() {
            window.open('child.htm', '', 'width=200,height=100,resizable=no');
            window.focus();
        }

        //opener with focus, works both in IE and FF
        function newwindow_opner_focus() {
            var myChild = window.open('child.htm', '', 'width=200,height=100,resizable=no');
            myChild.opener.focus();
        }
</script>
        

5 Responses to "Window.Open in IE and FF"

  1. Great information. Lucky me I found your website by accident (stumbleupon). I’ve book-marked it for later!
  2. It’s hard to find well-informed people in this particular topic, however, you sound like you know what you’re talking about. Thanks!
  3. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it.
  4. Thanks for a marvelous posting! I definitely enjoyed reading it, you’re a great author. I will ensure that I bookmark your blog and will come back sometime soon. I want to encourage that you continue your great work, have a nice day!
  5. Well, This is a great source. But I hope you keep posting and updating this site. Have a great day.

Leave a Reply




Privacy Policy | Terms of use
css template ready for  n°web
© 2008 2009 2010 by http://nazmulweb.com