How do I add Javascript to pages using Core functions?
The syntax you gave is correct. I suggest you:


Ensure your code is actually running (add a debug statement or exit(); in your code).
Clear your caches. If your page is being cached by the cms then that might be why you're not seeing it.