All Collections
Technical documentation
Register to document events
Register to document events
Gabriele Manasse avatar
Written by Gabriele Manasse
Updated over a week ago

Bablic triggers various events on the localized web page. You can receive those events using Javascript on real-time.

Register to document events

Bablic events are also fired on the document object with the prefix "bablic".
This is very useful if you're not sure whether Bablic library code was loaded yet in the document, in case you have a code that runs before Bablic Snippet or you are using async version of snippet.
Any data that was sent with the event is available on the event object, on the "detail" property (If the browser supports custom events). It's is not possible to return any value when using this method.

document.addEventListener('bablicload',function() { bablic.languages.hide('it'); });
Did this answer your question?