go to link on button click - jquery

前端 未结 5 1732
情书的邮戳
情书的邮戳 2021-01-31 17:41

I have a script as below

$(\'.button1\').click(function() {
    document.location.href=$(this).attr(\'id\');
});

the button1 has variable uniqu

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 18:07

    you can get the current url with window.location.href but I think you will need the jQuery query plugin to manipulate the query string: http://plugins.jquery.com/project/query-object

提交回复
热议问题