且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Javascript& SEO

更新时间:2023-08-18 13:48:40

搜索引擎机器人没有javascript,因此他们不会看到通过AJAX等动态添加到您页面的任何内容。在您的浏览器选项中,关闭Javascript并重新加载您的网站。他们将看到的只是内容和链接。

Search engine bots don't have javascript, so they won't see any content that was dynamically added to your page via AJAX, etc. In your browser options, turn off Javascript and reload your website. All that they'll see is the content and the links there.

解决方案:在您的页面上,在纯HTML中放置一个指向页面的链接,其中显示其余部分你的内容(你将通过AJAX加载的东西),然后让Javascript替换与内容的链接。搜索引擎机器人将看到链接并关注它,索引您的所有内容。只需确保在这些低保真页面上,您提供返回常规页面的链接,因为这将是Google将链接到的页面。

The solution: on your page, in the plain HTML place a link to a page which shows the rest of your content (the stuff that you would load via AJAX), then have Javascript replace that link with the content. The search engine bots will see the link and follow it, indexing all your content. Just make sure that on these lo-fi pages, you provide links back to the regular page, since that's what Google will link to.