添加了javascript,现在链接不起作用

use*_*021 0 javascript jquery

我添加了javascript来检测单击链接的时间,这是正常的,但是现在链接不起作用(即,它们不会将用户带到链接页面).

HTML:

<div class="designflow" style="padding-left:50px;padding-right:0px;padding-top:0px;padding-bottom:15px;margin-top:0px;float:left; font-size:18px; color: gray; height:150px; width:150px;margin-left:auto;margin-right:auto;display:inline-block;"> 
<a href = "/manufacturing/" class = "designflow" id = "manufacturing">
<img src="{{STATIC_URL}}pinax/images/manufacturing.png" width = "150px" style=margin-bottom:0px;" alt=""><br>
<p style="position:absolute;bottom:25px;padding-left: 0px; padding-right:0px; width:150px;text-align:center;">Manufacturing</p></a>
</div>
Run Code Online (Sandbox Code Playgroud)

JQUERY:

jQuery( 'div.designflow a' )
    .click(function() {
        do_the_click( this.id );
        return false;
    });
function do_the_click( designstage )
{
    alert(designstage);
}
Run Code Online (Sandbox Code Playgroud)

Run*_* FS 8

点击处理程序由于返回false而禁用它们

从事件处理程序返回false时,告诉运行时停止处理它.这还包括停止默认操作.在这种情况下,阻止链接成为链接.

如果你删除'return false'行.然后链接将作为链接通常再次工作

jQuery( 'div.designflow a' )
    .click(function() {
        do_the_click( this.id );
    });
Run Code Online (Sandbox Code Playgroud)

但是,从您可能希望返回false的方法名称中取出,然后在事件处理程序中处理重定位.

在JavaScript中,您可以导航到这样的新网址:

window.location = newUrl;
Run Code Online (Sandbox Code Playgroud)