It's usually it's done in php, and I know it would be a stretch to get it to work properly with javascript, but an example is like when you post a url to sites like Facebook, and Twitter those sites parse the urls and get tags such as title, and even image previews to give the user a better idea of what the link is about.
Of course another question would be if it should even be in the index.html, as many games are hosted in other pages.