Ahoy everyone,
I try to load content into a div using this tutorial. I am using jquery for this. The problem is that, when i click the link
<a href="about.html" class="panel">Profil</a>
it loads about.html as a seperate page. I tried it with several scripts, but for some reason it looks like
$("#content").load
does not work at all! I am sure my HTML is valid as i took it nearly 1:1 from the tutorial and only modified the targets.
heres the full javascript;
$(document).ready(function() {
// Check for hash value in URL
var hash = window.location.hash.substr(1);
var href = $('#nav li a').each(function(){
var href = $(this).attr('href');
if(hash==href.substr(0,href.length-5)){
var toLoad = hash+'.html #content';
$('#container').load(toLoad)
}
$('#nav li a').click(function(){
var toLoad = $(this).attr('href')+' #content';
$('#container').hide('fast',loadContent);
$('#load').remove();
$('#wrapper').append('<span id="load">LOADING...</span>');
$('#load').fadeIn('normal');
window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
function loadContent() {
$('#container').load(toLoad,'',showNewContent())
}
function showNewContent() {
$('#container').show('normal',hideLoader());
}
function hideLoader() {
$('#load').fadeOut('normal');
}
return false;
});
});
What could be possible reasons of this?