Hello! I'm a newb in ajax stuff, so this is my first project with jquery load().
I did this step-by-step instruction http://net.tutsplus.com/tutorials/javascript-ajax/how-to-load-in-and-animate-content-with-jquery/ and it seems to be so easy. The result: works with Webkit and Gecko, but IE 7 + 8, what a surprise, they load no content. The demo of nettuts do it in IE, so what the hell did I wrong?
The code:
// Check for hash value in URL
var hash = window.location.hash.substr(1);
// load content
var href = $(".mainNav li a").each(function() {
var href = $(this).attr('href');
if (hash == href.substr(0,href.length-5)) {
var toLoad = hash + ".html #content";
$("#content").load(toLoad)
}
});
$(".mainNav li a").click(function(){
var toLoad = $(this).attr('href') + "#ajaxedContent";
$("#content").fadeOut(300,loadContent, function(){
dynHeights();
});
$("#load").remove();
$('#logo').append('<div id="load"></div>');
$("#load").fadeIn(100);
window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
function loadContent() {
$("#content").load(toLoad,'',showNewContent())
}
function showNewContent() {
$("#content").fadeIn(300, function() {
dynHeights();
hideLoader();
});
}
function hideLoader() {
$("#load").fadeOut(300);
}
return false;
});
Note: the dynHeights() helps to change heights of shadow borders and should not be part of the problem
any ideas? would be appreciated.