How to get current user name using spservices.js:
Then download the SPUtility.js file from http://spservices.codeplex.com/ and jquery-1.11.2.min.js file as well.
<script type="text/javascript" src="/Style Library/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="/Style Library/spservices.js"></script>
var currentAbsoluteUrl = window.location.protocol + "//" + window.location.host;
var currentUserName= $().SPServices.SPGetCurrentUser({
webURL:currentAbsoluteUrl,
fieldName: "Title",
debug: false
});
alert('User Name:'+currentUserName);
});
The other day, while I was at work, my cousin stole my iphone and tested to see if it can survive a twenty five foot drop, just so she can be a youtube sensation. My apple ipad is now broken and she has 83 views. I know this is completely off topic but I had to share it with someone!
ReplyDelete