开发者

Is it possible to delete a GET variable with Javascript?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜