Polling connection
One of Briz.js’s real-time features is polling. Polling is a system where clients continuously request data from the server at specific intervals. Polling is more resource-intensive, but it’s often a lifesaver for browsers that don’t yet support SSE or WebSockets.
Example
<div data-polling="/partials/polling" data-refresh="1s">
<h1 data-swap="result">...waiting for response</h1>
</div>
The code above automatically runs when the element (which is being polled by data) is loaded in the DOM, and only ends if the element disappears from the DOM.
Demo
...waiting for response
Go back