Guest User

Untitled

a guest
Nov 14th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/currentuser";
  2. $.ajax({
  3. url: url,
  4. headers: {
  5. Accept: "application/json;odata=verbose"
  6. },
  7. async: false,
  8. success: function (data) {
  9. var items = data.d; // Data will have user object
  10. console.log(items);
  11. },
  12. eror: function (data) {
  13. alert("An error occurred. Please try again.");
  14. }
  15. });
Add Comment
Please, Sign In to add comment