views:

2249

answers:

1

Hi,

I'm using the code that netadictos posted to the question here. All I want to do is to display a warning when a user is navigating away from or closing a window/tab.

The code that netadictos posted seems to work fine in IE7, FF 3.0.5, Safari 3.2.1, and Chrome but it doesn't work in Opera v9.63. Does anyone know of way of doing the same thing in Opera?

Thx, Trev

+1  A: 

Have you tried this?

history.navigationMode = 'compatible';

Reference, found via this page

I haven't actually tried it myself, but it looks promising.

Blorgbeard
thx for the quick reply but, no, that doesn't seem to work. Even putting onunload="alert('hi');" in the body tag doesn't work in Opera.
Trev
If onunload doens't fix this, check if you have it disabled via: opera:config#UserPrefs|HistoryNavigationModeIf not, then file bug with Opera: http://bugs.opera.com/wizard because presence of these handlers *should* disable DOM cache.
porneL