views:

24

answers:

2
+1  Q: 

Firefox back issue

Hello,

I am using a menu that switches from standard state to select state for an item by reading the current url

var where  = document.location.href;

My issue is that when using Firefox, if I switch to some items from the menu (for instance, I click home, donwload, contact) and press the back button the url is not read correctly so 2 items remain on the selected state. This only happens in Firefox (I've tested already in Explorer, Chrome and Opera)

So what I'm trying to ask: is there a way to handle the so called back button action in/for Firefox so I can fix my menu issue ?

A: 

Determine the select state on the server-side, this won't be an issue.

Kerry
Hello,It appears that this is the way to go, nevertheless Firefox's behavior is strange in this case.
wikiz
A: 

Like Kerry said I would also go with server side. But you can mix them both. Use server side to give your menu items a class:

// this will put the class selected on the link
<a href="..." class="<?=($opt=='this-links-name'?'selected':''>" link name </a>

And then use Javascript to look and "highlight" those classes. Though I would probably go with CSS for colors and style and JS only for transitions and such.

Hope it helps!

Frankie
Thanks, I went on the server-side way this time
wikiz