Google 或其他搜索引擎执行 JavaScript 吗?
我只是想知道 Google 或其他搜索引擎是否在您的网页上执行 JavaScript。例如,如果您使用 JavaScript 设置标题标签,Google 搜索引擎会看到它吗?
I am just wondering if Google or other search engines execute JavaScript on your web page. For example, if you set the title tag using JavaScript, does the Google search engine see that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
出于 SEO 目的进行的一些实验表明,至少大公司(例如 Google)可以并且确实遵循一些简单的 JavaScript。他们避免偷偷摸摸的重定向等,但一些基本的内容操作似乎确实可以通过。 (我没有方便谷歌自己确认或否认这一点的链接,这只是我之前处理此问题时遇到的各种帖子。)
但是,这通常被认为是不可靠的。如果出于任何重要目的进行 SEO,请不要依赖蜘蛛索引大量动态内容。
实际上有一个非常好的(无论如何,在我看来)答案这里 一个非常相似的问题。我喜欢这个答案的地方在于它如何分解生成良好的、可索引的、最重要的是可维护的网页的步骤,并正确分离关注点。尽可能地遵循这个过程通常会带来良好的搜索引擎优化、良好的可访问性和良好的设计技能。
There have been some experiments performed for SEO purposes which indicate that at least the big players (Google, for example) can and do follow some simple JavaScript. They avoid sneaky redirects and such, but some basic content manipulation does seem to get through. (I don't have a link handy for Google themselves confirming or denying this, it's just various posts I've come across when dealing with this before.)
However, this is generally considered unreliable. If SEO is being done for any important purpose, don't rely on the spiders indexing much dynamic content.
There's actually a very good (in my opinion, anyway) answer here to a very similar question. What I like about that answer is how it breaks down the steps for generating good, indexable, and best of all maintainable web pages with concerns properly separated. Adhering as much as possible to this process generally results in good SEO, good accessibility, and good design skills in general.
是的,Google 执行 Javascript。移动目标是多少。
Google 早在 2011 年就执行了一些 Javascript:http:// searchengineland.com/google-can-now-execute-ajax-javascript-for-indexing-99518
这篇 2012 年的文章记录了 Google 当时执行和未运行的 Javascript 的一些实验:http://moz.com/ugc/can-google-really-access- content-in-javascript-really
2014 年 5 月,Google 公开表示他们执行 Javascript:http://googlewebmastercentral.blogspot.com/2014/05/understanding-web-pages-better.html 虽然那篇文章说 Google 已经变得越来越好,但并没有公开关于 Javascript Google 执行和不执行的内容的详细信息,但想必他们在这方面的表现至少与 2012 年一样出色。
Yes, Google executes Javascript. How much is a moving target.
Google executed some Javascript as early as 2011: http://searchengineland.com/google-can-now-execute-ajax-javascript-for-indexing-99518
This article from 2012 documents some experiments on what Javascript Google did and did not run at the time: http://moz.com/ugc/can-google-really-access-content-in-javascript-really
In May 2014, Google said publicly that they execute Javascript: http://googlewebmastercentral.blogspot.com/2014/05/understanding-web-pages-better.html Although that post says that Google has been getting better, there are no publicly available details on what Javascript Google does and does not execute -- but presumably they are at least as good at it as they were in 2012.
我很确定他们不会。但是,您可以亲自查看:Google 有一个工具可以向您显示您的页面,因为它会将其视为 http:// /www.google.com/webmasters/
I'm pretty sure they dont. However, you can see for yourself: google have a tool which will show you your page as it sees it as http://www.google.com/webmasters/
如果文本位于页面 JavaScript 中,Google 将看到该文本。但它不会被视为标题元素的文本。
但是,嘿,这很容易测试。去做就对了。等两天。如果您随后使用 site:.... 搜索您的网站,请查看标题中的内容。如果它在那里,那么答案是肯定的:谷歌看到它,如果没有:不,谷歌没有。它很容易测试。
(ps:我的钱在:没有)
if the text is in the onpage javascript, google will see the text. but it will not be seen as the text of the title element.
but hey, this is quite easy to test. just do it. wait two days. if you then google your site with site:.... look whats in the headline. if it's in there then the answer is yes: google sees it, if not: no google doesn't. it's easily testable.
(p.s.: my money is on: no)
我们需要记住,JavaScript 是客户端语言,并且始终从客户端开始执行。如果所有标题或内容都是通过 javascript 实现的,那么它将从客户端输出,我怀疑它会出现在 Google 搜索中(同时如果在 .html 上输出,那么是的)。
如果我最新的说法是正确的,元标签是“搜索引擎的燃料”,并且它与 SEO 有联系,在 SEO 中,常见的机器人被编写脚本在您的网站上爬行。
We need to remember that JavaScript is client-side language, and always start executing from client-side. If all of titles or contents are via javascript then it'll be output from client-side, and I doubt it'll show up on Google search (meanwhile if outputted on .html, then yes).
If I am correct as of latest, meta tags are "fuel for search-engine", and it have ties to SEO, where it is common robots to be scripted to crawl on your site.