Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

HierMenu URL in new window

Posted on 2000-03-24
5
Medium Priority
?
175 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 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

721 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