I'm doing a project whose pages are loaded into a main container .
All link is an anchor but what is after the hash is really a path. My JavaScript is scheduled to detect hash swap events, so it picks up the path by subtracting the hash and loads the contents of the file into the main container .
Look at the script , it's very simple!
(function ($) {
function hashNavigate() {
var url = window.location.href;
var hash = url.substring(url.indexOf('#'));
hash = hash.replace("#", "");
if( /#/.test(url) ) { // se houver Hash (se nao for pagina inicial)
if(!$("#mainRow").html().length) { // se mainRow estiver vazia, apenas carrega o conteúdo
$("#mainRow").load(hash);
} else {
$("#mainRow").html("").load(hash); // senão, apaga o conteúdo e carrega o novo em seguida
}
}
}
hashNavigate() // executa a primeira vez
$(window).on("hashchange", hashNavigate) // armazena no evento
})(jQuery);
In this way will my site be indexed?
obs : Every external document loaded in the main container does not have a complete HTML structure, just what should be loaded inside it and a tag > script.