regex - Remove anchor, but not arguments, via JavaScript -


i want change following example url

http://www.mydomain.net/site?argument1=test1&argument2=test2#anchor 

to

http://www.mydomain.net/site?argument1=test1&argument2=test2 

with javascript. how best that?

edit: 'anchor' , other text elements, meant generic elements. anchor text. sorry.

if you're trying change current location's anchor, it's better change window.location.hash:

window.location.hash = ''; 

in browsers avoid reload of page url changes.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -