Results 1 to 4 of 4

Thread: hyperlink question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Posts
    88

    hyperlink question

    Hi, this script creates the menu and sub-menus and links them to another page. but it open the links in a new window how to change it to open link in the current window?

    Code:
    //Create main menu
    var menu = new menuObject("menu",pageWidth/2,pageHeight/2,"Gallery",pageHeight/2);
    menu.startAngle = -90;
    
    //show menu and caption
    menu.show();
    menu.showCaption();
    
    //Add submenus
    menu.addItem("Personal","window.open('/personal')")
    menu.addItem("Friends","toggle");
    menu.addItem("Others","toggle");
    menu.addItem("Outings","toggle");
    menu.addItem("Family","toggle");
    
    menu.subMenus[1].addItem("Friend1","window.open('/script/script22.asp')");
    menu.subMenus[1].addItem("Friend2","window.open('/script/script17.asp')");
    menu.subMenus[1].addItem("Friend3","window.open('/script/script16.asp')");
    menu.subMenus[1].addItem("Friend4","window.open('/script/script15.asp')");

  2. #2
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    Change "window.open" with "location.replace". This will replace the page in the current window. One disadvantage: the "removed" page won't appear in the history.

  3. #3
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    If you use document.location.href='newpage' instead of replece I think it should not damage the history.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Posts
    88
    ok thanks for the reply~

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