Thursday, June 12, 2014

SharePoint 2013 Decoding Search “Refinement” Webpart URL Querystring Using JSOM

Scenario: SharePoint2013 How to extract and decode the “filter category” and “filter term” from the URL that “refinement” webpart constructs using JSOM.

Solution: If we observe the URL when we filter page contents using refinement webpart, the URL will be similar to:-
In the above “RefinableString00” is the filter category and the refiner term is HEX encoded in “636f6d6d756e69636174696f6e7320616e64206d6564696120736563746f72”
The following JSOM code extracts and decodes them.