Wednesday, October 29, 2014

Retrieve Search Center URL from a SharePoint page

I have previously written about how you via REST can retrieve the Search Center URL for a particular SharePoint site.

If you are already on a page which has a search web part on it, you can get the same value from the page itself with the following command:

Srch.ScriptApplicationManager.get_current().states['searchCenterUrl']


To be clear; when a search web part exist on the page search Search.ClientControls.js is loaded and makes the Srch namespace available.

No comments:

Post a Comment