Board Thread:Support Requests - Getting Technical/@comment-3974211-20140907120954/@comment-2170536-20140907204019

That should work just fine. If it isn't working, it could be that there is an error somewhere else in your MediaWiki:Common.js file that is causing it to abort before it reaches that line. You may want to check your console to see if it is spitting out any errors.

Be aware that unless the user page is protected, that creates a gaping security hole in your wiki, as you've now given the entire world the ability to add potentially dangerous JavaScript.