Expand my Community achievements bar.

SOLVED

$(document).on("foundation-contentloaded") dialog event is not working as expected in AEMaaCS

Avatar

Level 6
I have used the below code to detect a dialog load event for previous versions of AEM (I think AEM 6.3). Currently I am using AEMaaCS and when I use the same, I notice that the control is never going inside the below code:
$(document).on("foundation-contentloaded", function (e) {
});

Please share if there is any solution or any other way of doing this.
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @ibishika 

 

Please use with below code:

 

(function ($, $document) {
$document.on("dialog-ready", function () {
// code will go here
console.log("dialog ready now!!!");
});
})($, $(document));

This will be executed when the dialog is loaded.

 

Thanks! 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @ibishika 

 

Please use with below code:

 

(function ($, $document) {
$document.on("dialog-ready", function () {
// code will go here
console.log("dialog ready now!!!");
});
})($, $(document));

This will be executed when the dialog is loaded.

 

Thanks!