Needs a semicolon at the end for some browsers.

For best results set up a js linter (i.e. jshint) with your editor to catch this sort of thing automatically.