title: How to get active directory user name without domain name?
body: <p>I am getting this in my SharePoint output  in script editor. executions as follows:</p>
  
  <pre><code> i:0#.w|iscsharepoint\administrator
  </code></pre>
  
  <p>The code for this is as follows for this</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function GetLoggedInUserName()
  {
  var context = new SP.ClientContext.get_current();
  this.website = context.get_web();
  this.currentUser = website.get_currentUser();
  context.load(currentUser);
  context.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
  }
  
  function onQuerySucceeded(sender, args)
  {
   alert(currentUser.get_loginName());
  }
  
  function onQueryFailed(sender, args)
  {
  alert('request failed ' + args.get_message() + '\n'+ args.get_stackTrace());
  }
  &lt;/script&gt; 
  </code></pre>
  
  <p>Now I am trying to get it this excution.</p>
  
  <pre><code>"Hi Administrator"
  </code></pre>