$(document).on("foundation-contentloaded") dialog event is not working as expected in AEMaaCS | Community
Skip to main content
ibishika
Level 4
Apr 27, 2021 1:56 PM UTC
Solved

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

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.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Apr 27, 2021 2:33 PM UTC

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! 

1 reply

Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Apr 27, 2021 2:33 PM UTC

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! 

Translate