Ajax魔术:Kotaku如何实现Ajax *和* Google可访问性?

时间:2011-05-10 18:00:02

标签: ajax seo

Kotaku推出了一款没有乱码的新设计。他们的网站仍然清楚地使用ajax请求,但不知何故,它仍然通过Google 找到,内容显示在pagesource 中。他们是如何做到的呢?他们的文本似乎包含在脚本类型= text / javascript中,但我不明白它有什么影响,或者为什么会这样做。 (当然,第一页请求可能只是触发静态的,服务器端构造的响应。但是检查其他文章,它确实通过ajax请求加载json。没有页面刷新)

以这个网站为例:

http://kotaku.com/5800326/read-some-of-new-tomb-raider-game-right-now

没有哈希,一个格式正确的网址,它出现在Google中。我已经阅读了Google Ajax指南,据我了解,如果你使用#,Google只会请求一个html快照!在你的网址内。

为了您的方便,我制作了一个屏幕截图,显示了Chrome调试器中文本的外观:(“ganjaAjaxContent”是什么意思?) enter image description here

如果您搜索此文章,那么这是Google的第一场比赛: Google search for Kotaku article

能够做ajax而不必担心Google搜索会很棒。

1 个答案:

答案 0 :(得分:1)

Kotaku和其他Gawker网站正在为SEO做很多事情:

  • 为其所有内容提交XML站点地图
  • 正确使用Google和Facebook的标题和说明标签

    • <title>Read Some of New Tomb Raider Game Right Now</title>
      <meta name="fragment" content="!">
      <meta name="title" content="Read Some of New Tomb Raider Game Right Now" />
      <meta name="description" content="Upcoming Tomb Raider reboot doesn&#039;t have a release date yet, but website Siliconera apparently has the game&#039;s script and published what&#039;s reportedly an excerpt from it. Check it out. [Siliconera]" />
      <meta property="og:title" content="Read Some of New Tomb Raider Game Right Now" />
      <meta property="og:description" content="Upcoming Tomb Raider reboot doesn't have a release date yet, but website Siliconera apparently has the game's script and published what's reportedly an excerpt from it." />
  • 关闭Javascript时显示HTML帖子内容(检查<div class="post-body quick-post"></div>元素)

所以你是对的,谷歌的第一次访问加载了语义的,可访问的服务器端构建的页面。如果Google 可以抓取hashbang页面,则不需要,因为所有页面都是通过sitemap.xml编制索引的

希望这能解答您的所有问题。

P.S。说完这一切后,hashbangs对网络来说还是不好的