Solved

HierMenu URL in new window

Posted on 2000-03-24
5
168 Views
Last Modified: 2012-05-04
In the following Javascript code snippet, an array is created for an HierMenu (see http://www.webreference.com/dhtml/hiermenus ).  My question is in respect to the line "javascript:top.location='www.excite.com'".   When this menu item is chosen, then the URL will be displayed within the CURRENT browser window.  However, I would like to have the URL displayed in a NEW browser window, so that the original page is not lost, rather than in the current browser window.  Can this be done?


arMenu1 = new Array(
160,
"","",
"","",
"#3399FF","#55BBFF",
"#0000FF","#000088",
"Test 1","javascript:top.location='www.excite.com'",0,
"Test 2","http://www.yahoo.com/index.htm",0,
"Services","http://www.webreference.com/index2.html",0,
"About","http://www.webreference.com/about.html",0
)
0
Comment
Question by:Monroe406
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Accepted Solution

by:
HolySpirit earned 50 total points
ID: 2656141
Monroe406,
Yes, this can be done, try this out :

use :
javascript:open('www.excite.com')
instead of
javascript
javascript:top.location='www.excite.com

- Holy Spirit
0
 
LVL 2

Expert Comment

by:HolySpirit
ID: 2656147
Monroe406,
Sorry,
the script should look like this :

javascript:open('http://www.excite.com');top.history.go(-1)

-- Holy Spirit
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2656193
replace ...


javascript:top.location='www.excite.com'

with

javascript:window.open('www.excite.com,"MenuPopup")
0
 
LVL 10

Expert Comment

by:kollegov
ID: 2656230
javascript:window.open('http://www.excite.com','winName');

you can use any name as winName to
open NEW window. and than if selected again open in the same window..
(or create new one if was closes)

you als can use
'_blank' as name to open in NEW window, but in this case new window will be created each time when this one called.

0
 

Author Comment

by:Monroe406
ID: 2656865
OK, your answers were all correct, but I still have a problem.   I am trying to create a HTML page, using the Javascript above, on my Windows 98 ACTIVE DESKTOP.   In other words, rather than use a bitmap wallpaper, my desktop is a HTML page...with a Javascript hierMenu, using the code above.

The problem is...a new window does NOT pop up when the menu item corresponding to "javascript:window.open('http://www.excite.com','_blank')" is chosen from the menu.

Any ideas why?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How do i use the await event in php echo 5 44
Table header must be on top 2 57
Pass a js value to an html form 5 42
radio button onclick function 2 14
This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question