title: SharePoint get current user accountname?
body: <p>Does SharePoint 2010 store the current user's accountname somewhere in a globally accessible JS object?</p>
  
  <p>Every solution I can find involves some variation of an ajax web service call and this seems like an extremely heavy solution to access what should be a trivial piece of information.</p>
  
  <p><strong>Things I can access easily:</strong></p>
  
  <ul>
  <li>Get current user id from <code>__spUserId</code></li>
  <li>Get current user name by scraping the html of the ribbon (eg: <code>$('#zz17_Menu').text()</code>)</li>
  </ul>
  
  <p>But neither of these is the accountname.</p>
  
  <p><strong>Things I would rather not do:</strong></p>
  
  <ul>
  <li>Get current user info with a SOAP call to GetUserProfileByName</li>
  <li>Get current user info by making an Ajax call for ../_layouts/userdisp.aspx</li>
  </ul>