We are providing HierMenus to you at no cost. HierMenus code requires a confirmed membership with internet.com. Please register by clicking here and come back soon to download your free copy of HeirMenus code.
Click Here to Register

Site Navigation
Bulletins
About
Documentation
FAQ
Samples
Known Issues
Technology Jobs

internet.commerce

Partner With Us














          
internet.com

IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

 
HierMenusCentral Enhance the Functionality of Your Web Site with DHTML HierMenus.
    

home / faq / faq 3

Frequently Asked Question #3

Question: How can I set the target for my menu items? I.E., How can I set up my menu items so that the URLs they include are opened up in a new window, a different frame, or so they overlay the current frame (like target="top")?

Answer: Each of the scenarios above have an answer that relates to the same powerful, but seldom used feature of the menus: The ability to include a javascript: URL in the menu items. Any JavaScript statement or function call can be used in place of an http:// URL. This gives you the ability to have a menu link do...anything!

This feature was introduced and discussed in detail way back in HierMenus version 2.1. All versions since version 2.1 are compatible, with the exception of version 3.05 and versions 4.0 - 4.0.5, which inadvertently introduced related problems.

Let's illustrate the use of javascript: URLs by answering the questions above directly. For the sake of the examples, we'll assume that you want to link to HierMenusCentral.

  1. Loading a page into the full window.
    Assign the URL to the location property of the JavaScript top object, which represents the full window:

    DisplayText:"HierMenus Central",
    LinkURL:"javascript:top.location='http://www.hiermenuscentral.com/'",
  2. Loading a page into a new window.
    Use the window.open() method, placing the URL as the first argument. You may also specify any of the other arguments of the open() method:

    DisplayText:"HierMenus Central",
    LinkURL:"javascript:window.open('http://www.hiermenuscentral.com/')",
  3. Loading a page into any frame (specifying a "target").
    Like the first example, we can assign the URL to the location property of any frame. If you have a frame built with a name= attribute value of seventhFrame (<frame name="seventhFrame">), and you want a linked-to page to appear in it, then the JavaScript statement in your menu item would be:

    DisplayText:"HierMenus Central",
    LinkURL:"javascript:top.seventhFrame.location='http://www.hiermenuscentral.com/'",

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Created: 3/25/2004
Updated: 3/25/2004
URL: http://www.hiermenuscentral.com/documentation/faq/faq3.html