javascript - 搜索引擎处理 Javascript 吗?

标签 javascript html seo search-engine

根据 this page看起来他们没有,因为他们实际上并没有运行它,但该页面已有 2 年历史(从版权信息来看)。

我问这个问题的原因是因为我们使用 Javascript 将我们网站上的文本替换为其他打印更合理的内容。我们担心这可能会影响我们网站的可抓取性/搜索引擎优化,因为通常我们要替换的是标题; IE。 <h1> , <h2>

搜索引擎机器人会看到我们的原始代码,还是会运行 Javascript 并看到替换的文本?

最佳答案

Google now officially processes JavaScript.

In order to solve this problem, we decided to try to understand pages by executing JavaScript. It’s hard to do that at the scale of the current web, but we decided that it’s worth it. We have been gradually improving how we do this for some time. In the past few months, our indexing system has been rendering a substantial number of web pages more like an average user’s browser with JavaScript turned on.

  • Sometimes things don't go perfectly during rendering, which may negatively impact search results for your site. Here are a few potential issues, and – where possible, – how you can help prevent them from occurring:
  • If resources like JavaScript or CSS in separate files are blocked (say, with robots.txt) so that Googlebot can’t retrieve them, our indexing systems won’t be able to see your site like an average user. We recommend allowing Googlebot to retrieve JavaScript and CSS so that your content can be indexed better. This is especially important for mobile websites, where external resources like CSS and JavaScript help our algorithms understand that the pages are optimized for mobile. If your web server is unable to handle the volume of crawl requests for resources, it may have a negative impact on our capability to render your pages. If you’d like to ensure that your pages can be rendered by Google, make sure your servers are able to handle crawl requests for resources.
  • It's always a good idea to have your site degrade gracefully. This will help users enjoy your content even if their browser doesn't have compatible JavaScript implementations. It will also help visitors with JavaScript disabled or off, as well as search engines that can't execute JavaScript yet.
  • Sometimes the JavaScript may be too complex or arcane for us to execute, in which case we can’t render the page fully and accurately.
  • Some JavaScript removes content from the page rather than adding, which prevents us from indexing the content.

关于javascript - 搜索引擎处理 Javascript 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2068571/

相关文章:

css - 为 Firefox 设计 HTML5 摘要箭头样式

javascript - jQuery 手机 : remember variable of page before

apache - 使用 .htaccess 重定向域后的所有内容

javascript - google bot 是否会在网站上触发 javascript 点击操作及其解决方案?

javascript - 提交事件 preventDefault() 不适用于带有 os9 的 iPad/iPhone

javascript - Socket.IO 在 Express 4 路由上发出

javascript - 脚本 src 为 'arguments'

javascript - JQuery AJAX 问题 - 也许跨域?

javascript - 删除多个标点符号后面的标点符号javascript

c# - 通过代码隐藏将 CANONICAL 标签添加到我的页面以进行 SEO?