Skip to content

Instantly share code, notes, and snippets.

@bga
Created August 12, 2010 13:56
Show Gist options
  • Save bga/521000 to your computer and use it in GitHub Desktop.
Save bga/521000 to your computer and use it in GitHub Desktop.
window.onunload = function()
{
var _check = function(lbl)
{
var a;
if(window.document && document.body)
a = 'body';
else if(window.document && document.documentElement)
a = 'documentElement';
else if(window.document)
a = 'document';
else
a = 'none';
(alert)('' + lbl + ' ' + a);
};
var time = 0;
var _checkThread = function()
{
_check(time);
setTimeout(_checkThread, 0);
time += 1;
};
_check('now');
_checkThread();
};
if(window.opera)
{
history.navigationMode = 'compatible';
location = 'http://google.com/';
}
/*
chrome v5
now body
0 body
ie7
now body
0 body
ff3.6
now body
0 body
opera
now body
0 body
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment