I have a custom list on root level site in SharePoint Online. I want to display the list data to one of my subsite pages.
I am using JSOM. How can I achieve this?
Following is my code which gets the data from the current site. But I want to fetch it from the root level site.
context = SP.ClientContext.get_current();
list = context.get_web().get_lists().getByTitle(listName);