The javascript declaration at the bottom needs to be text/javascript and not application/javascript (to be in line with other widgets)