I have found a dropdown menu on my form, when something is selected I need to reload the current page , But with an attached query string.
How would I go about doing this?
This is an old question but it came in Google search results for the first time.
The solution I made is similar to that of Andy.
window.location.pathname returns the URL of the page without query string. I then "?" + $ I am able to create a query string with Param ({'foo': 'bar', 'base': 'ball'}) , after which I have a pathname and window.location.href Set on
window.location.href = window.location.pathname + "?" + $ Ultimate ({'foo': 'bar', 'base': 'ball'})
Comments
Post a Comment