window.open()添加一个rel =" nofollow"属性 [英] window.open() add a rel="nofollow" attribute

查看:161
本文介绍了window.open()添加一个rel =" nofollow"属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将 rel =nofollow属性添加到 window.open() Javascript功能?或者这是让Google不遵循由Javascript或jQuery创建的链接的任何方式。

Is there a way to add a rel="nofollow" attribute to the window.open() Javascript function? Or is that any way to have Google not follow a link created by Javascript or jQuery.

更新

此外,这将是客户的产品,我将无法访问他们的文件。任何更改 robot.txt .htaccess 都不在桌面上。

Also, this will be a product for a client and I will not have access to their files. Any changes the robot.txt or .htaccess are off the table.

推荐答案

Google可以阅读javascript链接

在HTML5中, nofollow 链接类型只能与一起使用一个区域元素。

In HTML5, the nofollow link type may only be used with a and area elements.

因为你已经在使用javascript ..(和无法访问 robots.txt .htaccess 文件),没有理由不能使用正常(但隐藏)

< a href =http://exampe.com =nofollow ...等

支持您寻找的属性,因此明确且'合法'表示意图)

使用javascript来获取该URL( href属性 a 元素)将其传递给 window.open 函数.. < sup>但是,我不知道google是否会尊重这种方法。

Since you are already using javascript.. (and can not access the robots.txt or .htaccess files), there is no reason why you couldn't use a normal (but hidden)
<a href="http://exampe.com" rel="nofollow" ...etc
(something that does support the attributes you seek, thus clearly and 'legally' indicating intention)
and use javascript to grab that URL (href attribute from the a element) to pass it to your window.open function.. However, I do not know if google wil honor this method.

另外(关于你的更新问题),你也可以使用a设置这些指令元标题:

< meta name =robotscontent =nofollow> (并设置指向的rel = 跟随)。




根据这个优秀的官方谷歌解释给这个阅读或坐下来观看谈话..):

Also (regarding your updated question), you can also set those directives using a meta header tag:
<meta name="robots" content="nofollow"> (and set endorsed links to rel="follow").


According to this excellent official google explanation (do give this a read or sit back and watch the talk..):


Google如何处理nofollowed链接?

一般来说,我们不知道跟随他们。这意味着Google不会通过这些链接转移PageRank或锚文本。基本上,使用nofollow的
会导致我们从网络的整体
图表中删除目标链接。但是,如果其他网站在不使用nofollow的情况下链接到目标网页,或者在网站地图中将
网址提交给Google,则目标网页仍可能会显示在我们的
索引中。此外,重要的是
请注意,其他搜索引擎可能会以稍微
的不同方式处理nofollow。

In general, we don't follow them. This means that Google does not transfer PageRank or anchor text across these links. Essentially, using nofollow causes us to drop the target links from our overall graph of the web. However, the target pages may still appear in our index if other sites link to them without using nofollow, or if the URLs are submitted to Google in a Sitemap. Also, it's important to note that other search engines may handle nofollow in slightly different ways.

根据 wikipedia.org/wiki/Nofollow



  • 谷歌表示他们的引擎字面意义上的nofollow并且根本没有跟随链接。
    但是,由SEO进行的实验显示出相互矛盾的结果。这些研究显示谷歌确实遵循了这个链接,但它没有
    索引链接页面,尽管它可能是谷歌索引中的
    其他原因(例如其他非nofollow链接指向到
    页面。)。

  • 雅虎!跟随它,但不包括它们的排名计算。

  • Bing也遵循它,但不包括它们的排名计算。

  • Ask.com也尊重该属性。

  • Google states that their engine takes "nofollow" literally and does not "follow" the link at all. However, experiments conducted by SEOs show conflicting results. These studies reveal that Google does follow the link, but it does not index the linked-to page, though it might be in Google's index for other reasons (such as other, non-nofollow links that point to the page).
  • Yahoo! follows it, but excludes it from their ranking calculation.
  • Bing also follows it, but excludes it from their ranking calculation.
  • Ask.com also respects the attribute.



PS:应该是谁? em>知道(并且能够证明)这不起作用..留下评论,以便未来的读者知道这种解决方法不能按预期工作(我将修改我的答案以反映这一点) 。


PS: should anyone know (and be able to proof) that this wouldn't work.. leave a comment so future readers know that this workaround doesn't work as intended (and I'll amend my answer to reflect that).

这篇关于window.open()添加一个rel =&quot; nofollow&quot;属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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