0

I am currently working on a 0-21 solitaire game with multiple levels. When the player completes a level, I need to reset everything to their initial state, so I use window.location.reload(). But this method causes some inconveniences in the game like exiting fullscreen window.

So what I need is a method that resets everything to their initial state, just like refreshing the page, but without refreshing the page. Is that possible? (With pure javascript.)

Or alternatively, a way to refresh the page without exiting fullscreen window would also do the job.

Thanks in advance for all the answers.

Ercan Tomaç
  • 29
  • 1
  • 5
  • Does this answer your question? https://stackoverflow.com/questions/15897434/javascript-refresh-parent-page-without-entirely-reloading – atultw May 13 '21 at 14:19
  • Generally, we need to see code to help. – Kinglish May 13 '21 at 14:35
  • @atulw Unfortunately, it does the same thing as `window.location.reload()`. So it also exits fullscreen window. – Ercan Tomaç May 13 '21 at 14:40
  • @ErcanTomaç would it be acceptable to just re-enter fullscreen mode after reloading ? – TheEagle May 13 '21 at 15:20
  • @Programmer I tried it by doing this: `window.location.reload(); requestFullScreen();`. But it didn't work since `requestFullScreen()` method requires a "user interaction" like clicking a button etc. At least I assume the reason it's not working is this. – Ercan Tomaç May 13 '21 at 15:54

0 Answers0