开发者

How to get rid of hash in URL when redirecting?

开发者 https://www.devze.com 2023-01-29 19:30 出处:网络
I have a page with two forms on it. Both are submitted to the original url of the page (action=\"\"), the second one adds ahash segment to it (action=\"#second-form\"). When the second form is valid I

I have a page with two forms on it. Both are submitted to the original url of the page (action=""), the second one adds a hash segment to it (action="#second-form"). When the second form is valid I want to redirect to another page for a second step, but without #sec开发者_JS百科ond-form in the url.

Is this possible? It seems like no matter where I redirect the user to #second-form is always retained in the url (e.g. http://www.google.com/#second-form).


Maybe if you try to put this on your code it works..

<base href="http://www.theurlyouwant.com/"/>


Point your action to your filename of the page, instead of "".

E.g. (just a bunch of the same examples for different file names) action="index.html" action="index.asp" action="index.php" action="form.asp" action="form.php"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号