Note that you need to run this using a web server accessed by localhost or similar with an http request.