$.get("/mobileapi/userinfo", function(userInfo){ var username = userInfo["UserName"]; $.get('/game-auth/getauthticket', function(authTicket){ window.location.href=username(authTicket) }) })