Information related to the events OSM exposes
The event handler can be used by calling the following function:
The event handler supports the following events:
If either the EventType or callback parameter is not provided, the function will log an error on the console but will not throw an error to avoid causing issues on the page. If it is passed a string for EventType that is not supported, the function will also log an error as well.
Here are is an example of how the
window.Klarna.OnsiteMessaging.on function might be used:
Blocking the scrolling of the background when the informational modal is opened
In this example, the merchant is using the informationalModalOpened and informationalModalClosed events to block the scrolling of the background when the interstitial is opened and restore it when the interstitial is closed.