General developer forum
I have tried the same code you pasted and the alert function works just fine for me.
Make sure you are purging your cache everytime you amend the JS file
I spent 2 hours trying to figure this out....
I can't believe I didn't make sure the cache was clear.