Board Thread:Support Requests - Getting Technical/@comment-14779707-20131111043327/@comment-11733175-20131117130138

@Prince(ss) Platinum You are correct. is the same as: $( function {    foo; } ); and $( document ).ready( function {    foo; } ); I use it all the time in my scripts.

Back to the original question, wgUserName returns null if the user is logged out, it's probably a good idea to do something like: $( function {    if ( mw.config.get( 'wgUserName' ) ) {        $( '.username' ).text( mw.config.get( 'wgUserName' ); } } );