Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:55
Target=_top does not work in Netscape 4.x
Poster: GMBlaszczynski
Dated: Saturday November 22 2003 - 23:57:02 GMT
My menu items contain "target=_top;" The purpose is to get out of frames back into a full window. This works in Internet Explorer and Netscape Navigator 7.1, but not in Netscape Navigator 4.78. I tried all sorts of things, but can't fix it. Any ideas? Thanks.
Poster: GMBlaszczynski
Dated: Sunday November 23 2003 - 4:33:23 GMT
I did not state my problem clearly. I had a menu system using Milonic version 3.5.10. It worked well in Internet Explorer and Netscape Navigators versions 4.5 and 4.87, in Windows and MAC (but not Safari v1.0). I then switched to Milonic version 5.0, and after fixing obvious problems, I got things to work well except "target=_top" in Netscape Navigator 4.x. Any ideas what could be the problem?
Poster: John
Dated: Sunday November 23 2003 - 22:47:20 GMT
Try target=_new; or target=_blank;.
Also, post a URL so we can see your code.
Poster: GMBlaszczynski
Dated: Monday November 24 2003 - 22:34:03 GMT
I tried target=_new and target=_blank. When using Internet Explorer, both of the target designations created a second window, but not for all menu items. This I don't understand. I though target=_blank should always create a new window. In any case, it always created a new window when I went through certain sequences.
I posted two test web sites, one with version 3.5.10 menus, and one with version 5.0.RC25. The URL are, respectively:
http://www.arlingtoncare.org/Old/Ottoso ... toson1.htm
http://www.arlingtoncare.org/Ottoson/main/ottoson1.htm
In testing these web sites, I am concentrating on Netscape Communicator 4.78. The two web sites are nearly identical except for the menu version. (I can make them identical, if that's desired.) One can easily see numerous problems in version 5.0. In particular, target=_top is not taking effect in new version, yet it works OK in old version. The Javascripts (except menus) are identical on both web sites.
Interestingly, I observed that Netscape 4.78 works quite well on my Win 9x machines, but on my Win XP it occasionally crashes unexpectedly. When it does not crash, it sometimes comes up with unexpected messages.
Poster: John
Dated: Tuesday November 25 2003 - 14:19:01 GMT
Right now I'm not going to be able to help (that doesn't mean one of the other folks won't step in here). I don't have a NS anywhere close to the old version you're trying to get working, so I can't do any testing.
I don't use frames, but under v5 I do frequently use target=_new; and I always get the new window (with current browsers).
Poster: GMBlaszczynski
Dated: Wednesday November 26 2003 - 14:27:54 GMT
This is the problem. Using "target=_new" produces a new window, which is the undesirable effect. The purpose of "target=_top" is to stay within the same window, but get out of the frames.
I wish I did not have to support Netscape 4.x, but the school district still uses legacy setups based on Netscape 4.x browsers. As you know, budgetary problems in schools prevent them from keeping up with the latest. So I would greatly appreciate help anyone's help in testing Milonic Version 5.0 with Netscape 4.78 or 4.79.
If you don't have one of these browsers on your computer, you can get them from Netscape at:
http://wp.netscape.com/download/archive ... ve47x.html
Thanks.
Poster: kevin3442
Dated: Wednesday November 26 2003 - 20:49:49 GMT
I understand that your goal in using target=_top is to break out of a frameset. But when I visit your example sites, both old and new, I don't see any evidence that you're using frames, so I don't understand the need to break out of frames. Only thing I can think of is that you don't want your site to be coopted and presented inside of another site's frameset.
In any case, if the target=_top approach doesn't work, you could use the following javascript code on any page that you want to break out of a frame:
Code:
if (top.location != location) top.location.href = location.href;
There are lots of ways you could use this. You could put that in a <script> block in the <head> of the page. Or put it in a .js file that you source into pertinent pages. Or put it in another .js file that you already load into your pages (like menu_data.js). Or put it in a function, and call that function from the body's onload event (although that would probably be more cumbersome than I'd want to do). That code should work across browsers, including NS4.7.
Hope that helps,
Kevin
Poster: GMBlaszczynski
Dated: Wednesday December 3 2003 - 3:20:22 GMT
First, I want to apologize because (1) I am an amateur in Javascripts and only do or learn as much as I need at a moment, and (2) I have not been thorough in explaining the difficulties I have encountered. Let me try again.
The starting point is a test web site that is using old Milonic menus version 3.5.10.
http://www.arlingtoncare.org/Old/Ottoso ... toson1.htm
The menus on that web site work well in Internet Explorer, Netscape 7.1, 7.0, and 4.78 (and a few others, but NOT in Safari 1.0)
A typical menu item in the old version is.
,"Announcements","../main/announcements.htm target=_top",,,1
Please note the use of "target=_top." Its purpose is to get out of frames. To see how it is used, go to
Classrooms -> 6th Grade -> 610 Cluster
This opens a page with two frames and a second menu bar that allows navigation within the lower frame. Selecting any item in the original top menu (other than another classroom) restores the full window.
The new test web site based on Milonic version 5.0.RC25 is at
http://www.arlingtoncare.org/Ottoson/main/ottoson1.htm
That web site is nearly identical to the old one except for the version 5.0 upgrade.
One important I need to indicate about the new test web site is that menu items under "Our School" use a different scheme from the items under other headings. More specifically, the ones under "Our School" use "target=_new" and the other employ a Javascript "targetTop" (see below).
My initial approach at converting the menu items to version 5.0 was to use:
aI("text= Announcements;url=../main/ announcements.htm;target=_top;separatorsize=1")
I was expecting this to work because "target" is listed as one of the allowed properties. In Internet Explorer, the menus worked as I expected.
But in Netscape 7.1 or 7.0 the result was the opening of a new window. To see that, go to the new test web site using either 7.1 or 7.0 and select
Our School -> Address and Directions
This will result in two windows. Selecting more items in the second item (under Our School) does not produce more windows, but doing this in the first window always produces more windows.
In Netscape 4.78, besides producing new windows, the menus were not able to get out of frames. To see that, open the new test web site and select.
Classrooms -> 6th Grade -> 610 Cluster
This will open two frames. Next select
Our School -> Address and Directions
This will open the new page in the top frame, while leaving the bottom frame in place. (This menu item uses "target=_blank;")
If you don’t have Netscape 4.78, you can download it from:
http://wp.netscape.com/download/archive ... ve47x.html
After trying various approaches, one of the team members (Kevin) recommended that I use Javascript
if (top.location != location) top.location.href = location.href;
I did not try that. Instead I wrote a simple function (in off_server_warning.js)
function targetTop ( pageURL ) {window.open ( pageURL, "_top" );}
and used it in
aI("text=Announcements;url=javascript:targetTop(\"../main/announcements.htm\");separatorsize=1")
This made things a lot better. The opening of new windows in Netscape 7.1, 7.0, and 4.78 stopped. Now the menus do get out of the frames. To verify this, first select
Classrooms -> 6th Grade -> 610 Cluster
then go to
Parent Guide -> Introduction
(This menu item uses "targetTop" function.)
However, all is not perfect.
There are still problems in Netscape 4.78 (but not in 7.0 or 7.1).
Selecting
District -> Technology Newsletter
frequently opens two windows instead of just one. The associated menu item is
aI("text=Technology Newsletter;url=javascript:targetBlank(\"http://www.arlington.k12.ma.us/newsletter/t/index.html\");separatorsize=1")
where "targetBlank" is defined by
function targetBlank ( pageURL ) {window.open ( pageURL, "_blank" );}
The two windows seem to occur always when getting out of frames. Otherwise, the occurrence of the extra window seem random.
Another persistent problem in Netscape 4.78 is that the second row of menus is not centered. Occasionally, even the first row is not centered. This be seen by selecting.
Classrooms -> 6th Grade -> 610 Cluster
My conclusion is that "target=_top" is not working correctly in case of Netscape in version 5.0; it does work correctly in earlier versions. The work-around of using function "targetTop" is acceptable.
However, I would greatly appreciate any suggestions regarding the other two problems, the centering of the second menu and the opening of an extra window with "targetBlank"
Thanks,
George