anchor = window.location.hash;
anchor = anchor.substring(1,anchor.length); // enleve le #
//-- Juste pour l'archivage, voici le code que j'utilisais avant de savoir qu'une fonction js existait
var url = document.location.toString();
if (myFile.match('#')) {
var anchor = myFile.split('#')[1];
}
Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/1235"></script>
3 comments about "Récupérer une ancre dans l'URL en javascript"
var anchor = window.location.hash;
palleas on Sptember 01, 2008
spirit on Sptember 01, 2008
palleas on Sptember 02, 2008