» Forums
» DynarchMenu forum
» Support
» Opera and the Back button
Opera and the Back button
2005/05/10 05:03
Viewed 9167 times
Replies: 1/6

I'm trying to get the menus to work in Opera 8. So far I have run into a couple of issues.
1. Opera's right click context menu can't be prevented. I'ved lodged this with opera as a bug and they have said that it will be fixed (it's broken in 8 but works ok in 7)
2. If you load a page with a menu, then move to another page, then hit the back button the menu no longer works. Javascript errors are generated as follows...

http://www.dynarch.com/demos/hmenu/examples/actions.html
Event thread: mouseover
Error:
name: TypeError
message: Statement on line 1: Could not convert undefined or null to object
Backtrace:
Line 1 of eval script
ev || (ev = window.event);
if (! DynarchMenu._related(this, ev))
return false;
At unknown location
[statement source code not available]

I suspect this is some problem with Opera not correctly remembering the state of the javascript engine when you go back. I have logged this as a bug with opera as well and will update this thread if they give me an answer.

Opera seems to do things a little differently in that they supposedly remember the state of the DOM and javascript engine for each page so that when you go back everything should be as it was. One issue with this is that the document is not "reloaded" so the onLoad event is not triggered.

I'm just posting this here in case anyone has a workaround for this already.

Cheers

Re: Opera and the Back button
2005/05/10 10:42
Viewed 12440 times
Replies: 2/5

1. Opera's right click context menu can't be prevented. I'ved lodged this with opera as a bug and they have said that it will be fixed (it's broken in 8 but works ok in 7)

Well, that's clearly a bug in O8.

2. If you load a page with a menu, then move to another page, then hit the back button the menu no longer works. [...]

That's an interesting feature, but I doubt they can do it well.  If onload isn't called, then the menu doesn't appear--so unless the browser fully remembers all the DOM nodes and their data (because we're storing important bits of data in the DOM nodes themselves) then this “feature” will break the menu, and most probably a lot of other scripts too...

Sorry to hear these bad news about Opera.  We don't know of any workaround at this time.

last
Re[2]: Opera and the Back button
2005/05/13 02:54
Viewed 15476 times
Replies: 1/2

I've had a response from Opera. This is what I told them to do to replicate the problem.

  • Go to http://www.dynarch.com/ , there is a menu at the top just under the logo and it should work
  • TYPE "google.com" into the address bar and hit enter.
  • Hit the back button, then menu does not work for me
  • Reload the page and the menu works again
  • Hit the forward button to go back to google
  • Hit the back button and the menu still works
  • Hit the forward button again and reload the google page
  • Hit the back button again and the menu still works
  • TYPE "google.com" into the address bar and hit enter.
  • Hit the back button, then menu does not work for me

And this was their response...

  • If you go back Opera uses a cached version in which the script wasn't ended correctly. Therefore the script can't get active again it's ended by reloading the page.

I'm not sure I really understand what they mean and I'm hoping it might make more sense to you so that you might be able to suggest a work around or give me some more ammunition to fire back at Opera support.

Thanks

last
Re: Opera and the Back button
2005/06/06 18:35
Viewed 15224 times
Replies: 1/1

OK, I finally nagged the people at Opera enough for them to take a good look and see what was going wrong. It's actually fairly obvious in hindsight.

Inside the DynarchMenu.addInfo function you set up an event handler for the window.unload event to call DynarchMenu._cleanUp. This is the problem as it seems to remove the info structure needed by the menus. I tried removing the event setup call and I can now use the back button in Opera !! YAY !

The question then is, is it simply just a matter of removing that event or will that cause some other unforseen oddness elsewhere and will the removal cause problems for other browsers.

Cheers,
Michael

last
Google