使用jQuery,我如何更改此链接:
example.com/?one=1&two=1
对此:
example.com/?one=1&two=1&thisisadded=true
所以基本上在链接的末尾添加& thisisadded = true?
需要更改的链接在他们自己的div中,带有一个my-link类.
$('a.my-link').each(function () { var href = $(this).attr('href'); $(this).attr('href',href + '&thisisadded=true'); });
使用jQuery选择器替换选择器,该选择器将匹配您站点上的相应链接(如果我的不好).