I'm working in a solution inside a CMS (EPiServer).
If I use the console.log to check my object I get a null value.
$(document).ready(function () {
console.log("$('.EPiRequester').html() =" + $('.EPiRequester').html());
});
(function myLoop(i) {
setTimeout(function () {
console.log(i + $('.EPiRequester').html());
if (--i) myLoop(i);
}, 3000)
})(10);
$('.EPiRequester').html()
"EPi Requester"
To fix this issue, I changed my method to open the Dialog box. Opening a Dialog with a Iframe I'm able to run all javascript and jQuery.
I didn't understand what was the problem.
function openModalFromIframe(that) {
require(["epi/shell/widget/dialog/Dialog"], function (Dialog) {
var url = $(that).attr('data-iframe-url');
var title = $(that).attr('data-title');
var dialog = new Dialog({
Title: title,
loadingMessage: "Loading...",
defaultActionsVisible: false,
preventCache: true,
style: "width: 800px; ",
});
dialog.attr("content", '<iframe src="' + url + '" style=" width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden;"></iframe>');
dialog.show();
});
}
If someone get the same issue here are my workaround.