5 Replies Latest reply on Apr 14, 2016 11:37 AM by urs h.

    What is first? 'Document ready' or guideBridge.connect() ?

    urs h. Level 1

      Hi 

      I've implemented a custom AEM forms component. The implementation uses guideBridge and jQuery. I've built an own clientlib for jQuery that is loaded by the page (not the component) template. Now I wonder, when during page load in the browser both frameworks are ready to be used?

      When I use the idiom:

      window.addEventListener("bridgeInitializeStart", function(evnt) { var gb = evnt.detail.guideBridge; gb.connect(function (){ // intialization of my custom component starts here }) })

      is it safe to use jQuery (or any other clientlib) within the gb.connect's callback function? Is the jQuery clientlib loaded and the document ready at the time the callback function is called?

      Thank you.

      Regards,
      Urs