I have a jquery based website which requires no refreshing at all. But when you do refresh, you get thrown to the index page. I'm trying to get a # system inside the url (index#upload would load upload.php to #middle div). Now I got that kind of system working somehow, but it keeps refreshing my div all the time, and I'm not sure if this is the best way to do it:
if (window.location.hash) {
    var hash = window.location.hash.substring(1);
    switch(hash) {
        case "files.php":
            $("#middle").load(hash);
        break;
        case "upload.php":
            $("#middle").load(hash);
        break;
        case "update.php":
            $("#middle").load(hash);
        break;
        case "changepassord.php":
            $("#middle").load(hash);
        break;
        case "options.php":
            $("#middle").load(hash);
        break;
    }
} else {
}
Any better ideas for this? btw, I also have this linkbar, that should work along with it (I alredy have a code that changes the # depending on which link the user clicks on in this code /)
$(document).ready(function(){
    $('#sidenav a').click(function(e){
        e.preventDefault();
        href = $(this).attr('href');
        window.location.hash = href;
        urlLoad = href;
        $("#middle").load($(this).attr('href'));
    });
    $('#topbar .profile').click(function(e){
        e.preventDefault();
        $("#middle").load($(this).attr('href'));
    });
});
 
     
    