Ie 7 Tabs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manjitsarma
    New Member
    • Jul 2007
    • 34

    Ie 7 Tabs

    My website requires that users don’t open my website url in multiple tabs. Opening the url in new window is allowed.

    My question is, is there a way in javascript or otherwise to prevent users from opening the same url in multiple tabs?

    Regards...

    Manjit Sarma,Nobel Software Systems Pvt. Ltd.
    Bangalore
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Originally posted by manjitsarma
    My website requires that users don’t open my website url in multiple tabs. Opening the url in new window is allowed.

    My question is, is there a way in javascript or otherwise to prevent users from opening the same url in multiple tabs?

    Regards...

    Manjit Sarma,Nobel Software Systems Pvt. Ltd.
    Bangalore
    Yes there is JavaScript that opens a new window but doesn't open the page in a new tab. The JavaScript "window.ope n()" method will do this for you.

    If you set your hyperlinks to "target=_bl ank" used to open the page in a new window, but now they open in new tabs.

    So to open a page in a new window you need to apply the window.open JavaScript method to your button or hyperlink for the JavaScript "onclick" event...

    [code=vbnet]
    MyButton.Attrib utes.Add("oncli ck", "Javascript:win dow.open(""" + "MyPage.asp x""" + ",""" + "NameForOpenWin dow""" + ", """ + "toolbar=no,men ubar=no,width=8 50,height=400,r esizable=yes,sc rollbars=yes""" + "); return false;")
    [/code]
    Please note that I added a "return false" after the window.open() method. This prevents postback from occurring.

    Cheers!
    -Frinny

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      What is the difference whether its opened in a new windows or in a new tab?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by Plater
        What is the difference whether its opened in a new windows or in a new tab?
        Sometimes you don't notice a page being opened in a new tab..

        Or when you have a help page being opened for the aspx page the user's viewing, you want the help to be in a new window so that you can see both it and the aspx page at the same time....

        Comment

        • manjitsarma
          New Member
          • Jul 2007
          • 34

          #5
          Thanks for the reply.I will use the code to fix the issue.

          Regards...

          Manjit Sarma

          Comment

          Working...