Solved

HierMenu URL in new window

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can i get a 4  at the second console.log? 6 48
jQuery Validate 4 36
insert text field data into html script 13 41
jqury 17 28
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

808 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