I've come across the following links:<a href="#!"> do?
<a href="#!">
<a href="#!" class="mob-trigger" data-target="#mob-commercial">
In relation to the href, what does the addition of the exclamation mean?
I've come across the following links:<a href="#!"> do?
<a href="#!">
<a href="#!" class="mob-trigger" data-target="#mob-commercial">
In relation to the href, what does the addition of the exclamation mean?
在代码中注明您问过关于您也有data-target="#mob-commercial"
的问题。
那么发生了什么? href="#!"
被用作hack来调用一个javascript函数,该函数在<a>
标签上按下时使用data-target
属性,而不是通常使用的<button>
标签。
Technically, it means "Link to the element with id="!"
. You can see it working in this demo是什么。
实际上,它可能被用作黑客来获得链接而不实际链接到任何东西,以便JavaScript可以绑定到它。它可能应该替换为<button type="button">
。
因此技术上不需要感叹号,对吗? – seanied
这是正确的 –