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

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

  • April 27, 2021
  • 1 reply
  • 1432 views
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.
Best answer by Asutosh_Jena_

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_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
April 27, 2021

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!