0

I built a page that displays projects for a client. On this page there are also filters that can be used to filter through projects based on things like services, location, region, etc. The filters are being done using the Wordpress Plugin Ajax Load More and I built custom filtering functionality.

My client asked if I could add a filter query string to the URL so they can send that URL, with the query string, to a potential client and when that person would go to that URL the page would load with the already selected filters.

What I am trying to do is when a dropdown item is selected a query string is added to the URL WITHOUT refreshing the page. the URL change doesn't need to do anything just add the query string to the end of it so they can copy and send it to clients.

Is this possible to accomplish all while staying on the same page?

An Example:

www.example.com

When a dropdown filter is selected the url will change to:

www.example.com/?service=testService

user9664977
  • 789
  • 2
  • 15
  • 28
  • 1
    You can't just add to the URL without a full page reload, but that's not necessary to do what you need anyway. Just create a button that generates the URL with JavaScript and either copies it to the user's clipboard or puts the URL on the page somewhere where it can be copied – brianyates May 24 '18 at 15:33
  • Why not use fragment identifier instead `www.example.com/#service=testService` – Doug Coburn May 24 '18 at 15:34

0 Answers0