I already solved the Picture worked it turned out that I misplaced the return p.
This is the complete code.
function getProfPic(username) {
![Image]()
Sir btw I saw your showing spinning icon example I tested it and it worked in Firefox but it doesn't work in IE and chrome. I don't know what's causing this problem.
This is the complete code.
function getProfPic(username) {
var p1 = "";
$().SPServices({
operation: "GetListItems",
async: false,
listName: "UserInfo",
CAMLViewFields: "<ViewFields><FieldRef Name='ID'/><FieldRef Name='Account'/><FieldRef Name='Picture'/><FieldRef Name='Name'/></ViewFields>",
CAMLQuery: "<Query><Where><Eq><FieldRef Name='Name'/><Value Type='Text'>" + username + "</Value></Eq></Where></Query>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function () {
p1 = ($(this).attr("ows_Picture"));
p = "";
if (p1 == undefined) {
var webprotocol = window.location.protocol;
var webhost = window.location.host;
p = webprotocol +"//" + webhost + "/_layouts/images/person.gif";
} else {
p = p1.split(",")[1];
}
});
}
});
return p;
}
then I just add this to <img src='" + getProfPic(user) + "' /> and this is the resultSir btw I saw your showing spinning icon example I tested it and it worked in Firefox but it doesn't work in IE and chrome. I don't know what's causing this problem.