< script type ="text/javascript" >
function HashChangeHandler() {
alert( ' hash = ' + location.hash);
}
</ script >
…
< body onhashchange ="HashChangeHandler();" >
< a href ="#link1" > </ a >
< a href ="#link2" > </ a >
…
</ body >
* This source code was highlighted with Source Code Highlighter .
function inoffline(e) {
if (!e) e = window. event ;
...
alert( '! .' );
}
window.onload = function () {
document .body.onoffline = inoffline;
}
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/64305/