如果由jQuery添加,Google会看到rel = nofollow吗? [英] Will Google see rel=nofollow if it is added by jQuery?
问题描述
我在页面加载后通过jQuery向链接添加 rel = nofollow
属性。
Google会看到此属性吗?我在Google的官方文档中找不到任何内容。
I'm adding a rel=nofollow
attribute to links via jQuery after the page load.
Will Google see this attribute? I can't find anything in Google's official documentation.
推荐答案
虽然Google处理JavaScript并且可以索引大量动态内容,但是动态插入 rel = nofollow
时的特殊行为。它是测试 [1] 他们得出了这个结果:
Although Google processes JavaScript and can index a lot of dynamic content, there's a special behavior when inserting rel=nofollow
dynamically. It was tested[1] and they came up with this result:
DOM中的nofollow不起作用(链接被跟踪,页面被索引)。为什么?因为DOM中a href元素的修改发生得太晚了: Google已经抓取了链接,并在执行添加rel =nofollow标记的JavaScript函数之前将URL排队。
解决方案是插入整个链接 rel = nofollow
动态:
The solution is to insert the whole link with rel=nofollow
dynamically:
但是,如果在DOM中插入了带有nofollow的整个 a href 元素, nofollow与链接(及其URL)同时出现,因此受到尊重。
However, if the entire a href element with nofollow is inserted in the DOM, the nofollow is seen at the same time as the link (and its URL) and is therefore respected.
请参阅 5部分。提供来源的rel =nofollow的重要示例。
- We Tested How Googlebot Crawls Javascript And Here’s What We Learned
这篇关于如果由jQuery添加,Google会看到rel = nofollow吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!