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

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' ); } } ); It you ain't gonna achieve  like dat, foo!