r/learnwebdev • • Aug 16 '21

How exactly does a site like Geoguessr work?

I know this is a pretty vague question, so I’ll try to be more specific. In most tutorials I’ve watched on Youtube, each page of their site only does one thing. For example, it might be a blog site where one page creates a blog and there is one button to submit that then uploads the post and redirects you to another page.

When you play a game of geoguessr, you go to a page like geoguessr.com/challenge/abcdefg and there’s a little info about the challenge and a button to continue. When you hit continue, you’re not redirected to a different page, but yet the entire screen goes away and the game starts. Then after you make a guess, you play four more rounds and it resets the game four times without ever going to a different page.

How is this accomplished? I’m assuming it’s done using javascript, but is there a best way of doing this? Good practices vs bad practices? Is it just setting the game’s css to display: none at first and then only showing it when you click continue to get into the game?

Sorry if this is a bad question, I just lack experience with web development.

5 Upvotes

2 comments sorted by

0

u/[deleted] Aug 16 '21

[deleted] — view deleted comment

2

u/PurelyCreative Aug 16 '21

Oh ok, this is what I wanted to know, thank you very much. I’ll look into single page applications when I get home later.