Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Initializing JS components after loading offers

Alexander_Prikhodko
Level 3
Level 3

We are using Target loaded by Launch and consider using Target's Visual Composer with Experience Fragments exported from AEM. We also have quite a lot of components with custom JS initialization code which will be used in these fragments if we start using them.

What is the recommended way of calling this initialization right after an offer with a component is loaded? What event should our code handle to achieve this, if we don't know exactly when the offer will be loaded? Also, what will change in the approach if Launch's script is loaded with "async" or "defer"?

Our current Target version is 1.8.7.

1 Reply
Alexander_Prikhodko
Level 3
Level 3

Sorry for the confusion, our at.js version is actually 1.8.2.