<分区>
我可以通过在 css 中使用 display:none;
来隐藏内容。但我在许多网站上看到 Google 不喜欢 display:none;
。因为 jQuery 动画,我真的需要它。
现在我找到了通过 Javascript/jQuery 隐藏内容的新方法。
$(this).css({display:'none'});
这比 display:none;
好吗?这是 Google 友好的吗?
这是 fiddle
标签 javascript jquery html css
<分区>
我可以通过在 css 中使用 display:none;
来隐藏内容。但我在许多网站上看到 Google 不喜欢 display:none;
。因为 jQuery 动画,我真的需要它。
现在我找到了通过 Javascript/jQuery 隐藏内容的新方法。
$(this).css({display:'none'});
这比 display:none;
好吗?这是 Google 友好的吗?
这是 fiddle
最佳答案
Google 提供了一些准则,您可以遵循这些准则来确保您的网站安全,不会被抓取:
https://support.google.com/webmasters/answer/35769
请注意,Google 机器人现在可以理解并在网页上执行基本的 JavaScript,以查看用户实际会看到什么结果:
https://support.google.com/webmasters/answer/81766?hl=en
这是关于隐藏文本或链接的片段:https://support.google.com/webmasters/answer/66353
Hiding text or links in your content to manipulate Google’s search rankings can be seen as deceptive and is a violation of Google’s Webmaster Guidelines. Text (such as excessive keywords) can be hidden in several ways, including:
- Using white text on a white background Locating text behind an image
- Using CSS to position text off-screen Setting the font size to 0
- Hiding a link by only linking one small character—for example, a hyphen in the middle of a paragraph
关于javascript - 是否通过 Javascript 或 jQuery 隐藏内容 值得一试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18217547/