Great Naspinsky, I didn't know that functionality. However, How can I specify the another specific id's inside the click function? if I use $(this) is great for "group_link_" but I need to do specific things for another id's as you can see below:
Here is the real code which I have to replicate "i" times. This code is working for i=0. The specific id's for i=0 are: group_link_0 - group_content_0 - contact_list_0 And I should do the same for group_link_1 - group_content_1 - contact_list_1....etc.
$("#group_link_0").click(function()
{
$("#group_content_0").empty();
$().SPServices({
operation: "GetUserCollectionFromGroup",
groupName: $("#group_link_0").text(),
async: false,
completefunc: processUsersGroups
});
function processUsersGroups (xData, status)
{
var i = 0;
var email_user="";
$("#group_content_0").append("<ul id=\"contact_list_0\" class=\"contact_list\"><div id=\"paginator\" class=\"paginator_accordion\">");
$(xData.responseXML).find("[nodeName=User]").each
(
function()
{
if ($(this).attr("Email")!="")
{
email_user=$(this).attr("Email");
}
else
{
email_user="<i>Not Available in Active Directory</i>";
}
$("#group_content_0").append("<li class=\"contact\"><div class=\"user\"></div><div class=\"user_name\">"+$(this).attr("Name")+"</div><div class=\"mail\"></div><div class=\"user_mail\">"+email_user+"</div><div class=\"thick\"></div><div class=\"minus\"></div><div class=\"plus\"></div></li>");
i++;
}
)
if(i==0)
{
$("#group_content_0").append("There's no users available in this group");
}
else
{
$("#group_content_0").append("</div></ul>");
}
}
$(function(){ $("#paginator").pagination(); });
}
);