I need to find out if logged in user belongs to a specific sharepoint group (2010). I am using below code to get it. but getting javascript error as 'SPServices is null or not an object'.
<script src="/sites/XXX/XXXX/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="/sites/XXX/XXXX/jquery.SPServices-0.7.1a.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$().SPServices({
operation: "GetGroupCollectionFromUser",
userLoginName: $().SPServices.SPGetCurrentUser(),
async: false,
completefunc: function (xData, Status) {
if ($(xData.responseXML).find("Group[Name='Site Admin']").length == 1) {
alert("User in a group");
}
else{
alert ("User is not in group");
}
}
});
});</script>
So many are saying the error occurs if jquery files not referenced properly. I stored the files in a doc library and referencing it in javascript.
