jQuery SPServices get list guid

1 Sep

A very easy way to retrieve the guid of a list with SPServices: 

<script type="text/javascript" src="../ICTLibrary/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../ICTLibrary/jquery.SPServices-0.5.4.min.js"></script> 

<script type="text/javascript">
$("document").ready(function() { 

function GetListId(listName) {
var id = "";
$().SPServices({
operation: "GetList",
listName: listName,
async: false,
completefunc: function (xData, Status) {
id = $(xData.responseXML).find("List").attr("ID");
}
});
return id;
} 

var listid = GetListId("Plastic");
if(listid!=null)
{
$("#listid").append(listid);
}
else
{
$("#listid").append("list not found");
} 

});
</script>
<div id="listid" >Plastic list guid: </div>

7 Replies to “jQuery SPServices get list guid

  1. This is my first time visiting your site. I do envy you since you seem to get a lot more comments then I do. Do you have any secret tips on how I can get more comments or do I just have to be paitent? Anyway, keep up the good work.

  2. Hey dude, Steve here… Keep ‘em coming… you are doing a great job with this blog, inspiring many newbies like me… can’t tell you how much I appreciate all you do! – Steve

  3. Hello!, I am visiting your site yet again to see more of your updates. I found this really interesting and felt compelled to comment a little thank you for all your effort. Please continue the great work your doing!

  4. Wow I have read your article and by the way I found you website on Yahoo and I think after I read particularpost on you website especially this one I have my own opinion about what should I comment on the next hang out with my family, maybe tomorrow I will tell my familyabout this one and get debate.

Comments are closed.