So I'm making a web app that is sort of like adVenture Capitalist. My question is: is there a way to have a function continuously running even when I close the webpage? For example, let's say, I have 5 coins and there is a function that adds 5 coins every hour. I exit the page (close the browser) and return to that page 5 hours later. There would be 30 coins total from my initial coin value of 5 plus the 25 from the five hours.
I only know Javascript, HTML, PHP, and jQuery to some extent, so if you can please limit it to those languages. However if there are better or faster solutions using other languages please let me know. Thanks everyone :)