谷歌机器人是否从 javascript document.write() 索引文本?
假设我有这个:
<script type="text/javascript">
var p = document.getElementById('cls');
p.firstChild.nodeValue = 'Some interesting information';
</script>
<div id="cls"> </div>
那么,谷歌机器人是否会索引文本一些有趣的信息
?
谢谢!
Lets say I have this:
<script type="text/javascript">
var p = document.getElementById('cls');
p.firstChild.nodeValue = 'Some interesting information';
</script>
<div id="cls"> </div>
So, google robots will index text Some interesting information
or not?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
据我所知,谷歌机器人现在将索引 AJAX 和 Javascript 内容。有关参考,请遵循:
http://www.submitshop.com/2011/11/03/google-bot-now-indexing-ajax-javascript
让 Google 将 JavaScript 生成的内容中的链接编入索引
AFAIK, google robot will now indexing AJAX and Javascript stuff.For reference please follow:
http://www.submitshop.com/2011/11/03/google-bot-now-indexing-ajax-javascript
Get google to index links from javascript generated content
更新
SearchEngine watch 最近提到 Google 机器人是临时设计的阅读 JavaScript,准确引用
Update
SearchEngine watch has recently mentioned that Google bot has been improvised to read JavaScript, to quote exactly
我们需要向 GoogleBot 隐藏页面上的一些信息。由于信息不是极其敏感,我们使用 document.write()-s 来避免搜索机器人对有问题的内容建立索引。
2011 年第三季度晚些时候,我发现 GoogleBot 确实 对脚本内容建立了索引,所以我现在非常确定 Google 索引的内容远不止从内容中获取 URL,尽管它确实没有在任何地方记录深。
We've had a need to hide pieces of information on pages from GoogleBot. As the information wasn't extremely sensitive, we've used document.write()-s to avoid searchbots indexing content in question.
Later in 2011 Q3 I've found that GoogleBot did index the scripted content, so I'm pretty sure now that Google is indexing much more than just fetching URLs from content, even though it's really not documented anywhere deeply.
Google 不会对 JavaScript 代码或生成的内容编制索引。您只会在缓存中看到它,因为缓存的页面由包含 JavaScript 代码的完整文件组成,并且您的浏览器会呈现它。 Google 会扫描 JavaScript 以查找要抓取的 URL,因此如果代码通过 Ajax 等从外部文件中提取内容,则外部文件也有可能被索引,但与父页面分开。如果您希望内容被索引,则必须采用纯 HTML 格式。祝你好运!
Google doesn't index the JavaScript code or the generated content. You will only see it in the cache because the cached page consists of the complete file including the JavaScript code and your browser renders it. Google does scan JavaScript for URLs to crawl, so if the code is pulling content from an external file via Ajax, etc., there's a chance that the external file will also be indexed, but separate from the parent page. If you want the content to be indexed, it's got to be in plain HTML. Good luck!