4
Some talking to use #!
, others say to use History API and others say that the Google already runs Javascript.
I’m doing a project whose pages are loaded into a container leading.
All link is an anchor but what is after the hash is really a path. My Javascript is programmed to detect exchange events hash, then he takes the path by subtracting the hash and loads the contents of the container leading.
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 mine website will be indexed?
Obs: Any external document uploaded to container do not have a complete HTML structure, only what should be loaded inside it and a tag scripted.
Give a read on the escaped_fragment: https://developers.google.com/webmasters/ajax-crawling/docs/specification
– Alex Juchem
You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? Something needs to be improved?
– Maniero