SP.Navigation.topNavigationBar property (sp.js)
Gets a value that collects navigation nodes corresponding to links in the top navigation bar of the site.
Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013
var value = SP.Navigation.get_topNavigationBar ()
Return value
Type: SP.NavigationNodeCollection
Remarks
It must be null if the top navigation bar is defined in a different site or if the top navigation bar node collection has been deleted.