It worked when I used a python server instead of opening the HTML file, that must be the problem. Thanks for your help!