window.open to open in same window same tab

Discussion in 'HTML & Website Design' started by learnerabn, Sep 23, 2010.

  1. #1
    hi all,

    In my site i'm having some buttons for linking.
    <a href> tag works fine in firefox but in ie its not working.
    so i used window.open for linking.
    but the problem here is the link is opened in seperate window in ie and in firefox its opened in seperate tab i want that to open in same window and in same tab....

    Can any one help me...

    Thanks in advance....
     
    learnerabn, Sep 23, 2010 IP
  2. Martenxxx

    Martenxxx Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It isn't problem of your code. If new page will be open in tab or window depends on browser settings.
     
    Martenxxx, Sep 24, 2010 IP
  3. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What were you using for the button?

    Try window.location.href = 'http://example.com';

    The window open function is normally used to create new windows, but this will make it open the link in the same window:
    window.open('http://example.com', '_self');
     
    Cash Nebula, Sep 25, 2010 IP
  4. learnerabn

    learnerabn Peon

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yes Cash Nebula,

    it works Thank you....
     
    learnerabn, Oct 11, 2010 IP