Normal Links with javascript? in same window???

Discussion in 'JavaScript' started by itsall3, Mar 12, 2006.

  1. #1
    Hi guys,

    Im having a problem trying to find a way to just make a normal link in javascript.

    I have this function for my menu:

    function DoNav(theUrl)
    {
    window.open(theUrl);
    }

    But its opening the link in a new window, i would like it in the window it is clicked.

    Thanks for any help.

    Regards.
     
    itsall3, Mar 12, 2006 IP
  2. torunforever

    torunforever Peon

    Messages:
    414
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    function DoNav(theUrl)
    {
    window.location.href=theUrl;
    }
     
    torunforever, Mar 12, 2006 IP
    itsall3 likes this.
  3. itsall3

    itsall3 Active Member

    Messages:
    505
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Cheers mate, works great. :D

    Many thanks.
     
    itsall3, Mar 12, 2006 IP
  4. dgh1981

    dgh1981 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I am having a similiar problem, this is the area that controls the link and opens it in a new window how do I change this?


    if($mParams['onclick']) {
    $javascript .= '
    onClick: function(i){window.open(gotoList)}
    ';
    } else {


    Cheers
    Dylan
     
    dgh1981, Dec 18, 2010 IP
  5. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #5
    Change : window.open(gotoList) to : window.location.href = gotoList;
     
    tvoodoo, Dec 18, 2010 IP