Javascript Event System - search-results-page-load

From KickApps Documentation

Jump to: navigation, search

This article pertains to the Javascript Event System. You can refer to our list of Javascript Event System Supported Events to learn what else you can do with our event system.

Contents

Summary

This event is fired when the search results page is loaded.

Payload Parameters

searchTerm
(string) The search term entered by the user.
sortedBy
(string) The sort order of the list.
resultCount
(number) The amount of results returned from the search.
resultPageOffset
(number) The first item on this page of results.
resultPageEnd
(number) The last item on this page of results.

Execution Interruption

none

Example

function onSearchResultsPageLoad(data) {

   // do something here
   console.log(data.searchTerm, data.sortedBy, data.resultCount);

} var newEventId = Ka.events.listen('search-results-page-load', onSearchResultsPageLoad);