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

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -