javascript - 是否通过 Javascript 或 jQuery 隐藏内容 值得一试

标签 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/

相关文章:

java - 将 html 转换为 postscript 的最佳方法是什么?在 java

javascript - node.js:包括外部 grunt 配置

javascript - 解耦 Angular 模块

javascript - 如何使用 jquery 创建列表

javascript - 动画 bootstrap carousel-caption

jquery - 使用 Jquery 通过单击移动相应的 Div

html - 默认输入元素大小

javascript - AngularJS:如何使用 $filter 从对象数组中查找对象,给定数组中的属性值数组

javascript - Meteor Simple Schema - 当修饰符选项为真时,验证对象必须至少有一个运算符

jquery - 文本区域自动调整内容高度 jQuery