我想隐藏,删除或操纵URL显示在左下角的浏览器,如谷歌。
尝试使用JS:
<a href="https://example.com" onmouseover="window.status='google.com'; return true;" onmouseout="window.status=''; return true;">Example</a>
尝试使用CSS:
x一个一个一个一个x一个一个二个x
谷歌示例:
在谷歌,当你把指针在任何搜索结果或ahref标签它显示的URL状态像上面的截图,但当你点击它或复制它,你会发现不同的https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwizyLqk54X-AhWIUGwGHeqDA5EQFnoECCUQAQ&url=https%3A%2F%2Fexample.com%2F&usg=AOvVaw2g9Si57HiLP2X7LeNGKaHd
截图:
2条答案
按热度按时间wgmfuz8q1#
您可以使用
event.preventDefault
阻止链接传播,然后使用javascript重定向到另一个页面。下面是一个简单的例子:
希望对您有帮助!
fnx2tebb2#