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

Cqm wrote: @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' ); } } );

Actually, I consider that to be okay for me, it's pretty funny to say "Hi, null!".