Widget JavaScript API
When the widget has loaded, it adds four methods to window.Feedzzie:
| Method | What it does |
|---|---|
Feedzzie.open() |
Opens the panel |
Feedzzie.close() |
Closes the panel |
Feedzzie.toggle() |
Opens the panel if it is closed, and closes it if it is open |
Feedzzie.destroy() |
Removes the button and the panel from the page |
The widget loads after the page, so the methods exist only once it is ready. Check before you call them:
if (window.Feedzzie && typeof window.Feedzzie.open === 'function') { window.Feedzzie.open()}Open the panel from your own button
Section titled “Open the panel from your own button”<button type="button" onclick="window.Feedzzie && window.Feedzzie.open && window.Feedzzie.open()"> Share feedback</button>The floating button stays on the page as well.
Remove the widget
Section titled “Remove the widget”Feedzzie.destroy() removes the button and the panel. To show the widget again, reload the page.