简体   繁体   English

悬停在链接上时,location.href使目标出现在状态栏中

[英]location.href make target appear in status bar when hovering over link

I have the following piece of code which when clicked takes me to the dynamically rendered details page: 我有以下代码,当单击该代码后,我将带到动态呈现的详细信息页面:

<tr class="itemList" onclick="location.href='Details/' + @item.ID">

My only issue is, is that the target URL which would be website/Details/ID doesn't display in the status bar when you hover over the table row and this also means you can't open the link in a new tab (for instance in firefox this status bar appears in the bottom left corner when you hover over a link). 我唯一的问题是,当您将鼠标悬停在表格行上方时,目标网址(即网站/详细信息/ ID)不会显示在状态栏中,这也意味着您无法在新标签页中打开链接(对于将鼠标悬停在链接上时,该状态栏将显示在firefox中的实例中。

How can I get this target URL to appear in the status bar across different browsers and also be able to open them in new tabs. 如何获得此目标URL,使其在不同浏览器的状态栏中显示,还可以在新标签页中打开它们。

Thanks in advance. 提前致谢。

A little bit obvious, but still a correct answer in my opinion: 我认为有些明显,但仍然是正确的答案:

Use an anchor element, like below. 使用锚元素,如下所示。

<a href="details/your-id">Click me</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM