Search & Category

Search & Category

HTML
<script>
  SP.go('categoryAndSearchPage', {
    searchQuery: "SEARCH_QUERY", // optional, but recommended, null if category page
    categoryId: "CATEGORY_ID" // optional, but recommended, null if search page
  });
</script>

In some case search & category are the same pages from the technical point of view. In that case please use this snippet.