admin管理员组文章数量:1317915
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.
Update
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.
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.
Update
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.
3 Answers
Reset to default 3Google can read javascript links
In HTML5, the nofollow
link type may only be used with a
and area
elements.
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." 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.
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..):
How does Google handle nofollowed links?
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.
According to wikipedia/wiki/Nofollow:
- 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. also respects the attribute.
PS: should anyone know (and be able to proof) that this wouldn't work.. leave a ment so future readers know that this workaround doesn't work as intended (and I'll amend my answer to reflect that).
Is there a way to add a rel="nofollow" attribute to the window.open() Javascript function?
No, but Google probably doesn't give any weighting to URLs opened with window.open
in the first place.
Or is that any way to have Google not follow a link created by Javascript or jQuery.
nofollow
, despite its name doesn't ask search engines not to follow a link, only to not treat the link as an endorsement for ranking purposes.
Use robots.txt
if you want to ask search engines to stay away from URLs.
You could put a disallow in your robots.txt
本文标签: javascriptwindowopen() add a relquotnofollowquot attributeStack Overflow
版权声明:本文标题:javascript - window.open() add a rel="nofollow" attribute - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742023918a2415190.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论