I'm using ajax and I'd like to somehow turn the current page's url into a data object used for ajax method. I'm using window.location.search
to get the current url of the page and I'm not sure the best way to turn the url into a data object used for ajax.
URL (window.location.search):
?pickup-location=Orlando+Intl+Airport+%28MCO%29%2C+FL&dropoff-location=&pickup-date=07%2F16%2F2018&pickup-time=12%3A00&dropoff-date=07%2F17%2F2018&dropoff-time=12%3A00&discount-code-company=&pagination=1
End Goal:
data: {
pickup-location: "Orlando+Intl+Airport",
.... etc ...
pagination: page
},