function getCurrentUserInfo(fieldName)///////////////////////fieldName的值可以为"Name”,"Email"等/////////////////////
{
currentSite = getCurrentSite();
var thisField = "";
var thisTextValue = RegExp("FieldInternalName=\"" + fieldName + "\"", "gi");
$.ajax({
async: false,
url: currentSite + "/_layouts/userdisp.aspx?Force=True&" + new Date().getTime(),
complete: function (xData, Status) {
$(xData.responseText).find("table.ms-formtable td[id^='SPField']").each(function() {
if(thisTextValue.test($(this).html())) {
// Each fieldtype contains a different data type, as indicated by the id
switch($(this).attr("id")) {
case "SPFieldText":
thisField = $(this).text();
break;
case "SPFieldNote":
thisField = $(this).find("div").html();
break;
case "SPFieldURL":
thisField = $(this).find("img").attr("src");
break;
default:
thisField = $(this).text();
break;
}
// Stop looking; we're done
return false;
}
});
},
error:function(xData,Status,error)
{
unBlockPage();
alert("Get current user failed!");
}
});
return thisField.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g, '');
}
{
currentSite = getCurrentSite();
var thisField = "";
var thisTextValue = RegExp("FieldInternalName=\"" + fieldName + "\"", "gi");
$.ajax({
async: false,
url: currentSite + "/_layouts/userdisp.aspx?Force=True&" + new Date().getTime(),
complete: function (xData, Status) {
$(xData.responseText).find("table.ms-formtable td[id^='SPField']").each(function() {
if(thisTextValue.test($(this).html())) {
// Each fieldtype contains a different data type, as indicated by the id
switch($(this).attr("id")) {
case "SPFieldText":
thisField = $(this).text();
break;
case "SPFieldNote":
thisField = $(this).find("div").html();
break;
case "SPFieldURL":
thisField = $(this).find("img").attr("src");
break;
default:
thisField = $(this).text();
break;
}
// Stop looking; we're done
return false;
}
});
},
error:function(xData,Status,error)
{
unBlockPage();
alert("Get current user failed!");
}
});
return thisField.replace(/(^[\s\xA0]+|[\s\xA0]+$)/g, '');
}