链接上需要href吗? [英] Is href required on links?

查看:91
本文介绍了链接上需要href吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的问题是因为我有一些链接像按钮一样通过ajax提取内容,所以我不需要任何href。 (我从SEO的角度提出这个问题)

解决方案


链接需要href吗?


是的。没有href属性的锚点不是链接。


我问这个是因为我有一些链接,像按钮一样通过ajax提取内容

如果你这样做,那么做对吧。使用 Unobtrusive JavaScript pushState



链接你正在使用一个定位设备,并打开JS是不好的链接。


我从SEO角度问这个


搜索引擎不会执行您的JavaScript,所以伪链接(依赖于JS)只是它们的虚无黑洞有关)。


I'm asking this because I have some links that act like buttons that pull out content trough ajax, so I don't need any href on them.

(I'm asking this from the SEO perspective)

解决方案

Is href required on links?

Yes. Anchors without href attributes are not links.

I'm asking this because I have some links that act like buttons that pull out content trough ajax

If you are doing that, then do it right. Use Unobtrusive JavaScript and pushState.

"Links" that only work if you are using a pointing device and have JS turned on are not good links.

I'm asking this from the SEO perspective

Search engines won't execute your JavaScript, so the pseudo-links (which depend on JS) are just black holes of nothingness as far as they are concerned).

这篇关于链接上需要href吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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