View Full Version : Can't jump to anchors in Mozilla/Firefox

07-12-2004, 01:52 AM
I'm trying to create a glossary for a site. I have a small function that creates a popup with two frames. The one along the top, glossary1, contains an alphabetic navigation bar. The bottom frame, glossary2, contains the glossary. I want to click on an href=javascript:glossary(term) and have the popup window go to the term.

The code that I have works fine with IE, but I'm running into what I think is a bug in Firefox and Mozilla. When I click on one of the terms, the popup window will appear and navigate to the correct term. As soon as it finishes loading, it immediately returns to the top of the page.

This is the code that I'm using:

function glossary(term)

if (term) {

first = term.charAt(0);
first = first.toUpperCase();
//url = "glossary" + first + ".html#" + term;
url = "glossary" + first + ".html";
mywindow = window.open(url, 'mywindow','etc');
mywindow.glossary2.location.hash = term;

else {

mywindow = window.open('glossaryA.html', 'mywindow', 'etc');

Is this the correct way to jump to an anchor?

Thanks for your help.

07-12-2004, 02:10 AM

07-12-2004, 07:12 AM
Doesn't this work?

//url = "glossary" + first + ".html#" + term;

07-12-2004, 06:14 PM
Yes. Yes it does.

(I can't believe I missed that.)

Thanks for your help!