0.1.0 • Published 2 years ago
macross-suggestion-box v0.1.0
RWS Universal Suggestion Box
Suggestion Box that can be used in all RWS component.


Usage:
<script>
  window.addEventListener('load', function () {
    const script = document.createElement('script');
    script.src = 'https://www.unpkg.com/macross-suggestion-box@latest/dist/suggestion-box.umd.js';
    script.type = 'text/javascript';
    script.addEventListener('load', function () {
      const SuggestionBox = window.suggestionBox.SuggestionBox;
      new SuggestionBox('search_input_id', {
        baseUrl: 'https://searchSuggestionAPIEndpoint/',
        sid: 'sid',
      });
    });
    document.head.appendChild(script);
  });
</script>Parameters:
- 'search_input_id' is the search input id
- baseURL and sid