I really don't understand syntax of .replace :D Can someone please fix my code? Now it removes only &chat=1 from URL, but I need it to remove everything from &chat=1 to end of URL. Sample of URL:
http://xxxxxxx.xx/index.php?menu=1&submenu=1&chat=1&od=3&komu=1
Result what I need:
http://xxxxxxx.xx/index.php?menu=1&submenu=1
Result what is my code doing now:
http://xxxxxxx.xx/index.php?menu=1&submenu=1&od=3&komu=1
Code what I am using now:
location.href=location.href.replace(/&?chat=([^&]$|[^&]*)/i, "");
Thx for help, sorry for my english :)