SharePoint Quick Launch is one of the navigation facilities, which helps to quickly go to the most frequently used destinations. Quick Launch can contain the links to the lists, libraries and sub sites. Usually the quick launch appears to the left of the site page. We can add, remove and edit the links, present in this section. It is also called current navigation, as it is used to navigate between the elements of the current site. In order to customize the quick launch publishing, feature has to be enabled in the site.

Quick Launch can be configured by going to the site settings -> Navigation.

In this article, we will see, how to add the quick launch navigation programmatically, using JavaScript Object Model.
Internal Implementation
- Add the reference to jQuery file.
- <script language="javascript" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
- <script language="javascript" type="text/javascript">
- Within Document ready function, call SP.SOD.executeFunc, so as to load the on demand script SP.js . Call the main starting point function say: addNavigation.
- SP.SOD.executeFunc('sp.js', 'SP.ClientContext', addNavigation);
- Instantiate the client context and get the Web instance.
- var clientContext = new SP.ClientContext();
- var oWeb = clientContext.get_web();
- Create Quick Launch node object, using NavigationNodeCreationInformation Object.
- oQuickLaunchColl =oWeb.get_navigation().get_quickLaunch();
- //Create a navigation node using NavigationCreationInformation
- var oNavigation = new SP.NavigationNodeCreationInformation();
- oNavigation.set_title("Employee Master List");
- oNavigation.set_url("/sites/playground/Lists/Employees/AllItems.aspx");
- oQuickLaunchColl.add(oNavigation);
- Load the client context and execute the batch.
- clientContext.load(oQuickLaunchColl);
- clientContext.executeQueryAsync(QuerySuccess, QueryFailure);
Full Code
The full code to add quick launch navigation items is given below:





Tarun DPosted Aug 25, 2016, 1:34 AM
Nice one. Thanks for sharing..