I've researched this topic a bit but unfortunately haven't come up with many results, and I'm struggling to also word it. I apologize if this has been asked before.
I'm currently working on a university assignment that involves creating a dynamic web application for a video game review website. It's going pretty well for my first foray into JS and PHP, however, I've gotten stuck right at the end. The requirement is that the site needs to use JSON for storing data, and as such, I have a JSON file for the games uploaded to the site. Each game needs to have its own page. I know that I can have a base page for the games, and use JS to grab the data from the server and generate the contents from that.
Is it possible for me to create "dynamic" links to these pages? My idea was to store a variable in the URL, where the variable matches up to an ID for a game, but I'm unsure if this is possible.
Unfortunately I have no code to share that would be of use, and I am unsure of where to begin with this problem.
Thanks.
EDIT: To further explain my issue, a massively shortened version of the JSON file would be this:
[
{
"id": 1,
"name": "foo",
"description": "bar"
},
]
And with this, there would be a sort of "boilerplate" page, let's call it gameview.html
. Upon searching up the URL, for example, somename.com/whatevermethodforgoingtothespecificgamehere
, the JS on page load would successfully load the content from the json on the server, using the URL.