jquery: history.back(1) issue

前端 未结 3 1158
时光取名叫无心
时光取名叫无心 2021-02-13 19:09

I have an issue with jquery and history.back(): I got a link:

Link back

I cant use something like

3条回答
  •  死守一世寂寞
    2021-02-13 19:37

    Probably you are missing to specify event as function argument, try specifying that too:

    $("#backLink").click(function(event) {
        event.preventDefault();
        history.back(1);
    });
    

    In other words, you had problem on event.preventDefault(); which most likely prevented below code from running or working.

提交回复
热议问题