Script Callbacks to control fetch, load events

It would be really usefull to have some events to listen in the script, like on load, for adding loading animations for example while the script loads

  • Guest
  • Mar 11 2021
  • Future consideration
  • Attach files
  • Ted Benice commented
    27 Jun 11:25pm

    Hi All, In my application it would be great to be able to add a listener for a widget to be loaded. If we have a giant facebook feed (for example) then some scripts dont work as they cant accurately determine the dimension of elements in the dom until the feed is appended.


    So i could do something like document.addEventListener('my-widget-id-load', function()...) and react to it having finished.


    As it is now im resorting to using the mutationobserver to look for specific elfsight elements being added to the dom.

  • Admin
    Helga Kirsanova commented
    9 Jun 02:26pm

    Hello,

    Thank you for submitting your request!

    However, could you please provide me with some more details of the use case itself - do you mean our script on the stage of loading, or maybe other elements inside a widget?

    We'll be happy to consider the options 🙂