Wat ik ik nu heb:
<a href="link1.php" onClick="combined('content','inc_1.php','inc_1'); return false;">
Met bovenstaande link open ik een functie:
function combined(outputContainer,url,hash)
{
simplexhr.doxhr(outputContainer,url);
navigation.addHash(hash);
}
Met de simplexhr.doxhr functies laad ik content in de div met het id outputContainer en de pagina die erin geladen wordt is url. Hier ga ik verder niet op in.
Het gaat om de functie navigation.addHash(hash):
navigation={
addHash:function(hash){
document.location.hash=hash;
document.getElementById('hashbox').innerHTML=hash;
},
checkHash:function(){
if(document.location.hash){
var complexHash=document.location.hash;
complexHash=complexHash.replace('#','');
var doublePointIndex=complexHash.indexOf(':');
if(doublePointIndex == -1){
var openUrl=complexHash + '.php';
} else {
var openUrl=complexHash.split(':');
openUrl=openUrl[0] + '.php?' + openUrl[1].replace('-','=');
}
var hashBox=document.getElementById('hashbox').innerHTML;
if(complexHash != hashBox){
simplexhr.doxhr('content',openUrl);
document.getElementById('hashbox').innerHTML=complexHash;
}
}
}
}
var checkHashInterval = setInterval("navigation.checkHash()", 500);
DOMhelp.addEvent(window,'load',navigation.checkHash,false);
Iemand nu al ideeën of iemand die mee wilt helpen aan dit project? Laat het me weten!
Gr. Rogier