开发者

Is it possible to delete a GET variable with Javascript?

开发者 https://www.devze.com 2023-03-21 01:05 出处:网络
I have a dynamic search form and when I send a query it remains the values of the query in GET variables.

I have a dynamic search form and when I send a query it remains the values of the query in GET variables.

Now, I have a custom reset button too, 开发者_C百科that clear the fields, but with surprise I note that the new queries mantains the GET values and carry bad results.

Thanks for help.


i assume that you are having problems because get values stay in the url. so you can use

history.pushState(stateObj, "", ('http://localhost/'));

by replacing the localhost with your page link


Set the form's action attribute to a URL without parameters.

0

精彩评论

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

关注公众号