搜索引擎是否处理Javascript? [英] Do search engines process Javascript?

查看:110
本文介绍了搜索引擎是否处理Javascript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据这个页面,看起来他们似乎没有,在他们没有真正运行它的感觉,但该页面是2岁(根据版权信息判断)。

我问这个问题的原因是因为我们使用Javascript来替换我们网站上的文字以及其他更具印刷性的内容。我们担心这可能会影响我们网站的可访问性/搜索引擎优化,因为通常我们正在替换的是标题;即。 < h1> < h2> 等。

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

解决方案

< href =http://googlewebmastercentral.blogspot.com/2014/05/understanding-web-pages-better.html =nofollow>谷歌现在正式处理JavaScript。


为了解决这个问题,我们决定尝试通过执行JavaScript来理解页面。在当前网络的规模上很难做到这一点,但我们认为这是值得的。我们已经逐渐改进了一段时间的工作方式。在过去的几个月里,我们的索引系统已经开启了大量的网页,就像普通用户浏览器打开JavaScript一样。


  • 有时候在渲染过程中事情并不完美,这可能会对您的网站的搜索结果产生负面影响。这里有几个
    的潜在问题,并在可能的情况下 - 如何帮助您避免
    发生:
  • 如果JavaScript或CSS等资源位于单独的文件中被阻止(比如robots.txt)以便Googlebot无法检索它们,我们的
    索引系统将无法像普通用户那样查看您的网站。
    我们建议允许Googlebot检索JavaScript和CSS,以便您的内容可以更好地编入索引。这对于
    移动网站尤其重要,因为外部资源(如CSS和JavaScript)可帮助
    我们的算法了解网页针对移动设备进行了优化。如果
    您的Web服务器无法处理
    资源的抓取请求量,则可能会对我们呈现
    页面的能力产生负面影响。如果您希望确保您的网页可以由
    Google渲染,请确保您的服务器能够处理
    资源的抓取请求。

  • 一个好主意,让您的网站优雅地退化。即使浏览器没有兼容
    的JavaScript实现,这也可以帮助用户欣赏您的内容。它还可以帮助访问者禁用或关闭
    JavaScript以及不能
    的搜索引擎执行JavaScript。

  • 有时JavaScript可能过于复杂或者神秘的让我们执行,在这种情况下,我们无法完整和准确地呈现页面。 有些JavaScript从页面中删除内容而不是添加内容,这阻止了我们对内容建立索引。



According to this page it would seem like they don't, in the sense that they don't actually run it, but that page is 2 years old (judging from the copyright info).

The reason I'm asking this question is because we use Javascript to replace text on our site with other more typographically sound content. We're worried that this may affect the crawlability/seo of our sites, since generally what we're replacing is headers; ie. <h1>, <h2>, etc.

Will search engine bots see our original code, or will they run the Javascript and see the replaced text?

解决方案

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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆