Edit: Answer I was looking for is How can I get query string values in JavaScript?. I wasn't familiar with the term 'query string' so didn't have a good sense of what to look for.
I have a simple web application that takes search criteria in a web form and produces visualizations with data returned from a DB from those criteria. For the sake of this example, let's say the search form takes a searchString and a date, and returns some arbitrary array of data that is displayed in the UI.
I would like to add GET request handling such that, if given a get request such as:
http://myApp.com/?searchstring="MySearch"&date="1-1-1990"
I can use that input as if it was entered in the form and the "submit" button was clicked. However I am not sure how to build this functionality on the JavaScript end. My server already features a simple API which the JS frontend uses to communicate with a backend, however this only returns JSON which is interpreted by the UI.
Is there a simple way to create an event handler for GET requests and parse out the data contained? It seems similar to the API I use, but I am not sure how to run this on the client side or attach it to some sort of event handler.
Thanks