Solved

HierMenu URL in new window

Posted on 2000-03-24
5
159 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now