jquery SPGetCurrentUser()获取sharepoint 2007中当前登录的用户名 [英] jquery SPGetCurrentUser() to get the current logged in username in sharepoint 2007

查看:75
本文介绍了jquery SPGetCurrentUser()获取sharepoint 2007中当前登录的用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用jquery获取当前登录的用户名并将用户信息传递给可连接的webpart。
这是我在CEWP中写的。

I would like to use jquery to get the current logged in username and pass the user information to the connectible webpart. This is what I have written in CEWP.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>
<script type="text/javascript">           
    $(document).ready(function() {
        var thisUserAccount = $().SPServices.SPGetCurrentUser({
    fieldName: "Name",
    debug: false
});
alert(thisUserAccount);


 }    

    ); 

</script>      

但没有任何影响。我也没有看到来自警报的任何输出。我做错了什么?有没有更好的方法呢?

but nothing is hapening. I dont see any output from alert also. am I doing anything wrong? Is there any better way of doing it?

提前致谢。

推荐答案

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>

<script type="text/javascript"> 
    var thisUserAccount ;          
    $(document).ready(function() {
    thisUserAccount= $().SPServices.SPGetCurrentUser({
    fieldName: "Title",
    debug: false
});
</script>

这篇关于jquery SPGetCurrentUser()获取sharepoint 2007中当前登录的用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆