How to get the current list/library name using JSOM? So far I found two snippets which return GUID of the current list/library, but not the name.

// Using standard JSOM

// Using SP Services

I would prefer something which would not go for server callbacks.

1 Answer 1


Use ctx to get current list/library info. For Name or Title, It is


PS: No callback needed

Following information can be retrieved from ctx about current list/library in SharePoint 2010.

 [   "listBaseType", "listTemplate", "listName", "view", "listUrlDir",
    "HttpPath", "HttpRoot", "serverUrl", "imagesPath", "PortalUrl",
    "RecycleBinEnabled", "isWebEditorPreview", "rootFolderForDisplay",
    "isPortalTemplate", "isModerated", "recursiveView", "displayFormUrl",
    "editFormUrl", "newFormUrl", "ctxId", "CurrentUserId", "isForceCheckout",
    "EnableMinorVersions", "ModerationStatus", "verEnabled", "isVersions",
    "WorkflowsAssociated", "ExternalDataList", "HasRelatedCascadeLists",
    "CascadeDeleteWarningMessage", "ContentTypesEnabled", "SendToLocationName",
    "SendToLocationUrl", "StateInitDone", "TotalListItems", "CurrentSelectedItems",
    "LastSelectableRowIdx", "SelectAllCbx", "TableCbxFocusHandler", "TableMouseoverHandler",
    "existingServerFilterHash", "NavigateForFormsPages", "OfficialFileName", "OfficialFileNames",
    "WriteSecurity", "SiteTitle", "ListTitle", "isXslView", "clvp"

To find above info, paste the following line in browser's console.


Unfortunately, It is not documented by MSDN. The all we have for exploring it is: Browser's console.

  • You mean like this SP.ClientContext.get_current().ListTitle?
    – Naveen
    Commented Dec 28, 2015 at 10:58
  • No ... It will return the currently opened list in the browser. Try it in the browser console Commented Dec 28, 2015 at 11:00
  • Nopes, ctx is an list object having almost every data present in the list. You need to just write :- var listtitle=ctx.ListTitle;
    – Azam Khan
    Commented Dec 28, 2015 at 11:01
  • @AtishDipongkor sorry i didnt saw ur comment
    – Azam Khan
    Commented Dec 28, 2015 at 11:02
  • 3
    ctx is only availble on list view pages, not on list item forms, unfortunately. Not sure if it's relevant, but make sure you double check. Commented Dec 28, 2015 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.