Getting data to the server

Now the first step in getting this data to the server is figuring out where it lives; this actually lives in the location object. We're going to use the console to just play around with it.

The location is a global object that's provided by your browser, and on it we have a whole bunch of really interesting things like host, hostname, href, origin, and pathname. What we're going to be using is search.

As you can see in the following screenshot, search is the query string, everything from the question mark to the end of the word course, what I have highlighted here:

The goal is to get this into a more useful format. ...

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.