【问题标题】:Javascript.void problem i want to see the page new adress when i click on a href linkJavascript.void问题我想在点击href链接时看到页面新地址
【发布时间】:2020-11-10 00:49:56
【问题描述】:

它有效,但我想查看链接地址,以便人们可以将链接添加为书签,现在他们点击并仍然看到主链接地址“http://hemsidan/start_media.php

<a class="links_left" href="javascript:void(0)" onclick="load_huvud_meny('information.php', 'texten');">Information</a>

当您单击此链接时,您会在 http://hemsidan/start_media.php 中看到此链接

但我想看到的是链接地址http://hemsidan/information.php

【问题讨论】:

  • 你想重定向用户?
  • 这看起来像是 Push State 的工作。

标签: javascript onclick href


【解决方案1】:

我想做的是你可以在这里看到新地址

【讨论】:

    【解决方案2】:

    可以在href属性中添加链接地址,同时在onclick属性末尾添加“return false”。

    <a class="links_left" href="http://hemsidan/information.php" onclick="load_huvud_meny('information.php', 'texten'); return false;">Information</a>
    

    【讨论】:

    • 不,没有解决它。您可以在状态栏中看到它,但不是
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-29
    • 1970-01-01
    • 2011-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-11
    相关资源
    最近更新 更多