1
我真的不明白.replace的语法:D有人可以修复我的代码吗?现在它只从URL中删除& chat = 1,但我需要它从& chat = 1删除所有内容到URL的结尾。 范例网址:从url中删除参数
http://xxxxxxx.xx/index.php?menu=1&submenu=1&chat=1&od=3&komu=1
结果我需要什么:
http://xxxxxxx.xx/index.php?menu=1&submenu=1
结果是什么我的代码现在做:
http://xxxxxxx.xx/index.php?menu=1&submenu=1&od=3&komu=1
代码我现在使用的是什么:
location.href=location.href.replace(/&?chat=([^&]$|[^&]*)/i, "");
Thx for he LP,对不起,我的英语:)
THX解释!问题解决了 :) – 2014-09-01 14:51:16