Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom galera, estava lendo esse artigo sobre AJAX+SEO+HTML5 e como sou noob ainda nessa area nao consegui entender direito como utilizar.
Para entenderem melhor segue artigo que estou falando.
Se resume em usar AJax com tecnicas de SEO.
porem não entendi direito como usar a função
$('nav a').click(function(e) {
url = $(this).attr("href");
//This function would get content from the server and insert it into the id="content" element
$.getJSON("content.php", {contentid : url},function (data) {
$("#content").html(data);
});
//This is where we update the address bar with the 'url' parameter
window.history.pushState('object', 'New Title', url);
//This stops the browser from actually following the link
e.preventDefault();
}
Mais precisamente não consegui entender essa parte,
$.getJSON("content.php", {contentid : url},function (data) {
$("#content").html(data);
});
Sei que se baseia mais na compreensão de getJson mas se puderem me ajudar não entendi muito na documentação.
Pelo que entendi ela vai buscar o arquivo content.php e escrever no elemento com id content, porem estava fazendo os testes e não consegui fazer funcionar, pra que serve contentid : url ?
Se não for pedir muito se alguém puder postar aqui ou no github o código de um exemplo dessa utilização.
Carregando comentários...