javascript - Get a substring from url jquery -


i working one-page website uses jquery , ajax. because 1 page website, url mydomain.com/#contact. have made ajax call , want refresh page , scroll particular section of page different id say, mydomain.com/#home. in order this, have current url using document.url (let's returns mydomain.com/#contact), remove /#contact , replace /#home. know can replace /#contact /#home concatenating + don't know jquery function (if any) remove /#contact.

thanks help

simply set hash, don't need evaluate existing url:

window.location.hash = "home"; 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -