Function

$().SPServices.SPListNameFromUrl

Certification

Certified for SharePoint 2007 Certified for SharePoint 2010

Functionality

This utility function, which is also publicly available, returns the current list's GUID *if* called in the context of a list, meaning that the URL is within the list, like /DocLib or /Lists/ListName.

Syntax

$().SPServices.SPListNameFromUrl();

Example

var thisList = $().SPServices.SPListNameFromUrl();

Available Options

listName
Option to allow passing in a URL to the function rather than simply picking up the current context. This will help where custom list forms are stored outside the list context.

Returns

The current list's GUID.

Last edited Oct 10, 2012 at 3:41 AM by sympmarc, version 6

Comments

ChrisRomp Dec 6, 2013 at 6:30 PM 
Ah nevermind. I see you mentioned elsewhere that you can often use the ID in place of parameters that require a name.

ChrisRomp Dec 6, 2013 at 5:58 PM 
Just wondering, why is this called "ListNameFromUrl" when it returns the Guid, not the list name? Should it be ListIdFromUrl?