missing reference in $.fn.SPServices.SPGetLastItemId
description
Hi Marc,
Once again, awesome library. But I found an issue, I wanted to get the last item id from a list in another SharePoint Web Application. I'm using an older version but I downloaded 0.7.1 just now to see if it had been corrected.
The section where you retrieve the userId needs to updated:
webURL: opt.webURL,
needs to be added in order for the webservice to pull the user info from the correct Site Collection.
corrected portion:
var lastId = 0;
$().SPServices({
operation: "GetUserInfo",
webURL: opt.webURL,
async: false,
userLoginName: (opt.userAccount !== "") ? opt.userAccount : $().SPServices.SPGetCurrentUser(),
completefunc: function (xData, Status) {
$(xData.responseXML).find("User").each(function() {
userId = $(this).attr("ID");
});
}
});