Results 1 to 3 of 3

Thread: [02/03] How to open/change new browser window

  1. #1

    Thread Starter
    Hyperactive Member Coool's Avatar
    Join Date
    Feb 2006
    Location
    System.Coool
    Posts
    333

    Arrow [02/03] How to open/change new browser window

    Hi all,

    I have one link in my brower for training chapter.

    When i click on 1st chapter of training from window1, it should open in new window named window2.

    But if i click on 2nd chapter of window1 then window2 should display 2nd chapter in the same window2 rather than displaying in new window.
    I am using .NET 2010 with Windows 7

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: [02/03] How to open/change new browser window

    You would be using javascript. Something like this...
    Code:
    <html>
    
        <script>
            var win;
    
    
            function OpenChapter(chapter) {
                if (win) {
                    win.document.location.href = "test" + chapter + ".html";
                } else {
                    win = window.open("test" + chapter + ".html", "win");
                }
            }
        </script>
    
        <a href="javascript:OpenChapter(1)">Chapter 1</a>&nbsp;<a href="javascript:OpenChapter(2)">Chapter 2</a>
    
    
    </html>
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Hyperactive Member Coool's Avatar
    Join Date
    Feb 2006
    Location
    System.Coool
    Posts
    333

    Re: [02/03] How to open/change new browser window

    Thanks man i really appriciate this one..
    I am using .NET 2010 with Windows 7

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width