How to open 2 window website all at once.

Last post 07-03-2009 9:49 AM by Sunil R Gami. 4 replies.

Sort Posts:

  • How to open 2 window website all at once.

    07-02-2009, 11:30 PM
    • Member
      30 point Member
    • Rudianto
    • Member since 08-28-2006, 10:13 AM
    • Posts 23

    Dear All,

    Anyone knows, how to open 2 page website in two windows, i want to open it all at once.

    i have tried this code but only one windows (www.okezone.com) have opened

    function winopen()
        {

            window.open ("www.detik.com","mywindow");

            window.open ("www.okezone.com","mywindow");

        } 

    Thanks,
    Rudianto

     

  • Re: How to open 2 window website all at once.

    07-03-2009, 3:05 AM

     hi,

    you have to use hyperlink or <a> tag to open two windows from same page

    with one function you can open ony one window.

    <a href="www.detik.com" runat="server">detlik</a>

    <a href="www.okezone.com" runat="server">okeqone</a>

    Thanks :)

     

     

    Remember to click “Mark as Answer” on the post, if it helps you. Because It helps others to find the solution.

    Srinivas Kotra.


  • Re: How to open 2 window website all at once.

    07-03-2009, 4:08 AM
    Answer
    • Participant
      1,052 point Participant
    • susmitadeb
    • Member since 07-22-2008, 12:29 PM
    • Pune , India
    • Posts 184

     Hi Rudianto  ,

    You can try with below code :

    <script type="text/javascript">

    function winopen()
        {


            window.open ("http://www.detik.com","mywindow");

            window.open ("http://www.okezone.com","mynewwindow");

        }

    </script>

    And add the below code :

    <body>

    <a href="#" onclick="return winopen();">www.okezone.com</a>
    </body>

    Hope this will help you.

  • Re: How to open 2 window website all at once.

    07-03-2009, 4:13 AM
    • Member
      636 point Member
    • ChaitanyaC
    • Member since 06-06-2009, 4:30 AM
    • Mumbai
    • Posts 94

     write this in page load, it's working in IE, Mozila:

     <script type="text/javascript">

    window.onload = s()

     function s()

    {

    window.open("http://google.com");

    window.open("http://msdn.com");

     }

    <script>

    ----------------

    you can call this function  on any event you require.

    ** Mark any post that really helps you as “ANSWER” to indicate all other viewers in future for reference; **
    Thnks,
  • Re: How to open 2 window website all at once.

    07-03-2009, 9:49 AM
    • Member
      42 point Member
    • Sunil R Gami
    • Member since 07-02-2009, 1:53 AM
    • Posts 6

    You just need to change the target window name. In the current code which you have given have same name in both the window... So try below code

    function winopen()
        {

            window.open ("www.detik.com","mywindow1");

            window.open ("www.okezone.com","mywindow2");

        }


    -------

    Mark As Answer, if this post is helpful.

Page 1 of 1 (5 items)