[SOLVED] Is there a code to refresh a window?

My game has a quit button which would just close the application window and the code for that function is simply

Quit.prototype.onPress = function (event) {
window.close();
};

I wanted to add a restart button for my game which would simply refresh the window. Is there a similar code to that?

https://www.w3schools.com/jsref/met_loc_reload.asp

However, I would consider unloading the scene and reloading the scene instead as that would be quicker than reloading the page.

1 Like