leoooo: Abfragen ob der Back-Button gedrückt wurde

Beitrag lesen

Dich interessiert die Aenderung der aktuellen Anker-Position in deiner Seite - also frage diese ab, und stelle fest, ob sie sich geaendert hat - location.hash.

ah, ja stimmt. habe mal folgendesscript gebaut

  
  
var aktive = window.setInterval("checkhash()", 1);  
  
function checkhash () {  
  
 if(typeof(oldhash) == "undefined"){  
 var oldhash = window.location.hash ;  
 }  
  
 if(window.location.hash != oldhash){  
  alert("hash has changed from " + oldhash + " to " + window.location.hash);  
  oldhash == window.location.hash;  
 }  
}  
  

warum funktioniert das nicht?