I some found a fix thanks to some one else advice but now I have a problem when loading and unloading content and trying to load new content into a div.
This is the code I'm using to load content into a hidden div, it loads the content, it fades up and scrolls to the top of the document if needed. Heres the code for loading content:
$(".director").click(function(){ // .director is the class of my links
var href = $(this).attr('href');
$('#cont_nota').load(href);
$('#cont_nota').fadeTo( 500, 1).css('opacity','100');
$("html, body").animate({ scrollTop: 0 }, "normal");
return false;
});
now from within the loaded content i use this code to close the window and unload its content:
$("#cont_nota").click(function(){
$('#cont_nota').fadeTo( 500, 0, function(){
$("#cont_nota").empty();
});
});
it works for a couple of clicks but after a few clicks nothing happens, the code stops working and I can see in the javascript console rue following legend:
Failed to load resource: net::ERR_CACHE_MISS
This seems to be an error in the Chrome Developer Tools console (see this post on SO: Bizarre Error in Chrome Developer Console - Failed to load resource: net::ERR_CACHE_MISS)
I'v been going about this all evening and I'm sure you can give me a hint.