[javascript] SharePoint 2013 get current user using JavaScript

try this code..

function GetCurrentUsers() {

    var context = new SP.ClientContext.get_current();
    this.website = context.get_web();
    var currentUser = website.get_currentUser();
    context.load(currentUser);
    context.executeQueryAsync(Function.createDelegate(this, onQuerySucceeded), Function.createDelegate(this, onQueryFailed));
   function onQuerySucceeded() {

       var currentUsers = currentUser.get_title();
       document.getElementById("txtIssued").innerHTML = currentUsers;

    }

    function onQueryFailed(sender, args) {
        alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
    }   

}