How to use brokerportal onlines
This section contains all informations about online
Embedding
Add code to website head
<script defer crossorigin="anonymous" src="https://api.brokerportal.sk/online/app.js"></script>
Add code to place where online should be shown
<div class="__bpo" id="custom-assigned-hash"></div>
Optional attributes
- data-custom-steps - number of steps client saw on your side, for example when you set 3 our first step will start with number 4
- data-hash - can be used to show exact contract process, hash could be obtained from API create service. Iframe will continue from last step finished, for example if already confirmed/finished, iframe will automatically show last step with summary and documents
Messaging
You can obtain usefull data from iframe via messages
How to listen to messages
Insert JS script
<script>
window.addEventListener('message', function(event) {
console.log("Message received from the child: ", event.data); // Message received from child
});
</script>
Messages
event.data contains data object in format
{
"online": "custom-assigned-hash",
"type": "string",
"data": "mixed"
}
Possible messages
| type | data |
|---|---|
| size |
|