updated js to respect https
my code is better
Merge pull request #5 from HancockAlan/master

Better than yours,...yes it is