Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firefox troubles

Status
Not open for further replies.

Errant

Programmer
Mar 30, 2005
3
CA
Hi folks. About two months ago a re-coded a web page so that the javascript on it would work properly in Firefox. But to my dismay, all of a sudden, I find that my javascript has since quit working (in Firefox), and I have made no changes to it. I didn't recall downloading any Firefox updates, but I suppose I could have just forgotten. Anyone know why this might be?

In any case, here's my problem. On the left-hand side of this RPG page ( you'll see a little menu box. Some of the things in the menu box are plain links, that change colour when you mouseover them, and they work fine. However, some of them aren't actually links, and I have JavaScript code to make them change colour when you mouseover them (simulating what the actual links do), and more code to generate a sub-menu when you click on them. Not only to they just flash annoyingly in Firefox, clicking on them also does nothing.

You can find the JavaScript file here (
 
you are entering infinite loops. your createMenu script writes html that calls your highlight and dehighlight functions. onmouseover, both of these functions are callod, which then again call the createMenu.

why are you using javascript to create these menus? in my opinion, this is probably the least effective way to do what you're doing. for one, these errors occur. second, the code won't be picked up by web crawlers, so your content won't be indexed. third, people with javascript disabled won't be able to navigate your page.

etc.



*cLFlaVA
----------------------------
[tt]( <P> <B>)[sup]13[/sup] * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Well, the reason that I'm using JavaScript is so that I don't need to edit every single page on my site every time I change the menu. I've since discovered inline frames, and I may eventually rewrite it using those, but that would be my original reason. I don't much care if web crawlers can't find it; there isn't any reason why you'd go to this site before you've already gone to the main site for the RPG group that my site is part of. And thus far, while I've gotten complaints from Firefox users, I haven't gotten any complains from people without JavaScript enabled. If that ever becomes an issue, I'll cross that bridge when I get to it.

If there are infinite loops, why doesn't it affect internet explorer? It runs just fine in that browser, it's only Firefox that I'm having problems with. If it was an infinite loop, wouldn't it have the same problem on all browsers?

Also, this problem did not occur when I last tested it on Firefox, several months ago, and the JavaScript has not been changed since.
 
IE and Firefox are different programs... and so what works on one may not work in the same way on another. One reason may be to do with your choice of a doctype (or lack of one).
...Also, this problem did not occur when I last tested it on Firefox, several months ago, and the JavaScript has not been changed since.
Well... I guess that you never tested the code properly in Firefox when you did your final upload (how else do you explain this - it's not like code magically rewrites itself).

Rather than labour on about why it happened... it's probably a good chance to update it (and maybe make that change to using iframes if you decide to go down that route).

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top