Move onload to index.html to make main an independent script