googlebot 能否识别 HTML标签被javascript改变了?
我的网站上有一个搜索引擎,它通过 ajax 运行。我希望每次搜索尝试都有一个特定的
您知道 googlebot 是否会看到此更改并使用它来索引我的网页吗?
感谢您的帮助!
I have a search engine on my website and it works via ajax. I want to have a specific <title>
for each search attempt. To achive that I have to alter every time after I recieve a response from ajax.
Do you have any idea if googlebot will see this altered and use it to index my webpage?
Thanks for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
很可能不会。
您应该在服务器端更改标题。
Most likely not.
You should change the title on server side.
Google bot 执行的操作类似于使用记事本打开页面 URL。它将把 JavaScript 代码视为纯文本,并尝试更改标题;但它当然不会看到脚本执行的结果。
编辑:
启用 Ajax 的网页使用相同的原理进行抓取,除非它们遵循启用 Ajax 的网站的技术,如 google 建议的那样:
AJAX 抓取:网站站长和开发人员指南
Google bot does something similar to opening the page URL using notepad. It will see the JavaScript code as a plain text, which tries to change the title; but it will not see the result of the script execution of course.
EDIT:
Ajax enabled web pages are crawled using the same principle, unless they follow the techniques for Ajax-enabled web sites, as suggested by google:
AJAX crawling: Guide for webmasters and developers
好吧,谷歌在过去几年中为其搜索引擎添加了许多功能,也许它能够看到这些变化。但是您如何想象客户应该到达一个地址不变但内容在点击几次后发生变化的页面?必须将AJAX与普通的独立页面结合起来;这还将增加对禁用 JavaScript 的客户端的兼容性。例如,如果启用了 JavaScript 并且用户代理字符串与
*bot*
不匹配,则所有页面都会重定向到使用 AJAX 的页面。Well, google added many features to its search engine over past years, and probably it will be able to see the changes. But how do you imagine a client should reach a page which address doesn't change, but content does after few clicks? You must combine AJAX with normal separate pages; this will also add compatibility for clients that have JavaScript disabled. E.g. have all pages redirect to the one working with AJAX if JavaScript is enabled and user-agent string doesn't match
*bot*
.简而言之,Google 不会为您页面中的任何动态内容编制索引。
正如斯拉瓦所说,谷歌在过去几年中为其搜索引擎添加了许多功能,也许它能够看到这些变化。但即使谷歌最终开始对动态变化的内容建立索引,我认为从搜索引擎优化的角度来看,这些内容不会像服务器提供的其他内容那样快速地被索引,这仍然是无趣的。
知道你得到什么和失去什么很重要。是的,您可以轻松地向页面添加功能并增强用户体验,但如果您没有对数据建立索引,您就会失去所有有趣的关键字优点。 :)
Simply, Google will not index any dynamic content from your page.
As Slava said, Google added many features to its search engine over past years, and probably it will be able to see the changes. But even if Google does eventually start indexing dynamically changed content, I think it is still uninteresting from a search engine optimization standpoint that those content will not be indexed as quickly as the others served from server.
It's important to know what you're getting and what you're losing. Yes, you may be adding functionality to your page easily and enhancing the user experience, but if you don't get the data indexed, you lose all that juicy keywordy goodness. :)