The reason I needed to do this was I had a client request to setup alerts form one list that had URLS that pointed to another list. The alerts really needed to be on the referenced list and not what the user was currently selecting in the list view.
$().SPServices({
operation: "GetListCollection",
async: false,
completefunc: function (xData, Status) {
$(xData.responseXML).find("List").each(function() {
if ($(this).attr("DefaultViewUrl").indexOf(listInternalName) >= 0) {
listName = $(this).attr("Title");
listId = $(this).attr("ID");
}
});
}
});
operation: "GetListCollection",
async: false,
completefunc: function (xData, Status) {
$(xData.responseXML).find("List").each(function() {
if ($(this).attr("DefaultViewUrl").indexOf(listInternalName) >= 0) {
listName = $(this).attr("Title");
listId = $(this).attr("ID");
}
});
}
});
Hope someone else finds this useful.