window.location和SEO [英] window.location and SEO

查看:90
本文介绍了window.location和SEO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 jQuery greaterlink 或简单 window.location 用于制作更大,更易于访问的链接。我想知道的是在这些情况下搜索引擎优化会发生什么 - 我在包含元素中有锚点链接,但谷歌会惩罚这些操作,因为我并没有真正点击链接。此外,还有其他解决方案(除了CSS定位)可能比这个更好吗?谢谢。

I'm trying to use something like jQuery biggerlink or just simple window.location for making bigger and more accessible links. What I'm wondering is what happens with SEO in these cases — I have anchor link in the containing element, but does Google penalize such actions since I'm not really clicking on link. Also, are there any other solutions (besides CSS positioning) which could be better than this one? Thanks.

推荐答案

从脚本中设置 window.location 将不会被发现通过搜索引擎(谷歌已检测到简单的 document.write 添加,但这不会捕获任何更高级的DOM脚本内容)。它对可用性也有害:所有常用的浏览器控件都可以获得链接,例如中键单击新标签,右键单击复制位置或书签停止工作。

Setting window.location from script will not be spotted by search engines (Google has detection for simple document.write additions but this won't catch any of the more advanced DOM scripting stuff). It's also bad for usability: all the usual browser controls you get for links, like middle-click-for-new-tab, right-click-copy-location or bookmark stop working.

greaterlink通过在HTML中保留正确的< a href> 标记来避免SEO问题,并在其顶部添加额外的点击处理。 (较大链接的较大部分仍然不响应例如中间点击,但'原生'部分确实如此。)只要你保持< a href> 在适当的地方你不必担心搜索引擎。

biggerlink avoids the SEO issue by keeping the correct <a href> markup in the HTML, and adding extra click handling over the top of that. (The ‘bigger’ parts of the biggerlinks still don't respond to eg. middle-click, but the ‘native’ parts do.) As long as you keep <a href> in an appropriate place you don't have to worry about search engines.

我不确定这些东西是否必要。我看到更大链接所做的效果可以很容易地使用带有'display:block;'的链接来完成,偶尔也可以使用像多个链接那样的解决方法来处理链接中的标题。当然它的标记更多一点,但脚本编写的内容要少得多,然后所有链接都会以链接通常的预期方式响应。

I'm not at all sure this stuff is necessary. The effects I've seen biggerlink do could easily be done using links with ‘display: block;’ and occasional workarounds like multiple links when you want to do things like headings inside the links. Sure it's a little more markup, but it's a lot less scripting and then all links respond in the expected way links usually do.

这篇关于window.location和SEO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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