Reference
http://sharepoint.stackexchange.com/questions/73032/get-current-user-in-client-object-model-with-javascript
Add a webpart page to sharepoint site
Add content editor webpart
Edit content editor webpart
Copy and paste the content mentioned below in HTML mode and save the webpat page
<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(init,'sp.js');
var currentUser;
function init(){
this.clientContext = new SP.ClientContext.get_current();
this.oWeb = clientContext.get_web();
currentUser = this.oWeb.get_currentUser();
this.clientContext.load(currentUser);
this.clientContext.executeQueryAsync(Function.createDelegate(this,this.onQuerySucceeded), Function.createDelegate(this,this.onQueryFailed));
}
function onQuerySucceeded() {
document.getElementById('userLoginName').innerHTML = currentUser.get_loginName();
document.getElementById('userId').innerHTML = currentUser.get_id();
document.getElementById('userTitle').innerHTML = currentUser.get_title();
document.getElementById('userEmail').innerHTML = currentUser.get_email();
}
function onQueryFailed(sender, args) {
alert('Request failed. \nError: ' + args.get_message() + '\nStackTrace: ' + args.get_stackTrace());
}
</script>
<div>Current Logged User:
<span id="userLoginName"></span>
<span id="userId"></span>
<span id="userTitle"></span>
<span id="userEmail"></span>
</div>
Thank u very much ..
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI am really impressed with your efforts and really pleased to visit this post.
ReplyDeleteselenium Training in chennai
amazon web services Training in chennai
Block Chain Training in velachery
This comment has been removed by the author.
ReplyDeleteAfter reading this web site I am very satisfied simply because this site is providing comprehensive knowledge for you to audience. Thank you to the perform as well as discuss anything incredibly important in my opinion. We loose time waiting for your next article writing in addition to I beg one to get back to pay a visit to our website in
ReplyDeleteData Science training in Chennai | Data science training in bangalore
Data science training in pune| Data science online training
Python training in Kalyan nagar
I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
ReplyDeletejava training in chennai
java training in marathahalli | java training in btm layout
Well somehow I got to read lots of articles on your blog. It’s amazing how interesting it is for me to visit you very often.
ReplyDeletepython training in pune
python training institute in chennai
python training in Bangalore
Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
ReplyDeleteBest Devops Training in pune
Usually, I never comment on blogs but yours is so convincing that I never stop myself to say something about it. keep updating regularly.
ReplyDeleteIELTS Classes in T Nagar
IELTS Classes in Chennai Valasaravakkam
IELTS Classes in Chennai Nungambakkam
IELTS Training near me
Best IELTS Classes in Porur
IELTS Training in DLF
IELTS Classes in Mugalivakkam
Thanks for the great content! keep uploading more post
ReplyDeleteselenium testing course in chennai
selenium course
iOS Training in Chennai
French Classes in Chennai
web designing training in chennai
Big Data Training in Chennai
website design training
website design courses
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThe Concept is really Awesome.every concept should be explained very neat and clean.
ReplyDeleteData Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery
its nice blog sharing this information..i nice to learned!!!
ReplyDeleteAndroid Training Institute in Chennai | Certification | Online Course Training | Android Training Institute in Bangalore | Certification | Online Course Training | Android Training Institute in Hyderabad | Certification | Online Course Training | Android Training Institute in Coimbatore | Certification | Online Course Training | Android Training Institute in Online | Certification | Online Course Training
After reading this website really i improve my knowledge...Thanks for your sharing...
ReplyDeleteAndroid Training Institute in Chennai | Certification | Online Course Training | Android Training Institute in Bangalore | Certification | Online Course Training | Android Training Institute in Hyderabad | Certification | Online Course Training | Android Training Institute in Coimbatore | Certification | Online Course Training | Android Training Institute in Online | Certification | Online Course Training
Awesome blog. Thanks for sharing such a worthy information....
ReplyDeleteIELTS Coaching in Pune
IELTS Coaching in Gurgaon
This post is so useful and informative. Keep updating with more information.....
ReplyDeleteDeveloper Testing
Software System Testing