可以googlebot做基本的javascript吗? [英] Can googlebot do basic javascript?

查看:144
本文介绍了可以googlebot做基本的javascript吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有类似这样的页面:

Suppose I have something like this page:

<noscript>You need JS for this page</noscript>
<script>
    document.write('you have javascript');
    $(function() { /* Some DOM heavy coding */ });
<script>

google会是什么样子?如果有人搜索谷歌你有javascript他们会看到我的页面吗?

What will this look like to google? If someone searches google for "you have javascript" will they see my page?

推荐答案

最安全的答案是:不要依赖在上面。特别是因为你正在进行繁重的DOM编码。

The safest answer is: don't rely on it. In particular because you're doing heavy DOM coding.

如果代码必须在Google中用于搜索目的,那么在服务器上创建HTML的那部分并仅使用JavaScript互动。 Google的网络抓取工具变得更加智能,但我不希望他们理解任意JavaScript代码。

If the code must be in Google for search purposes then create that part of the HTML on the server and use JavaScript only for interaction. Google's web crawlers are getting smarter but I don't expect them to understand arbitrary JavaScript code.

这篇关于可以googlebot做基本的javascript吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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