¿Puede echar un vistazo a este lápiz y decirme por qué obtengo un resultado incorrecto ( "iFrame is Empty" ) mientras que #this-frame ya está poblado con
$("#this-frame").contents().find("body").text("iFrame Lorem ...!");y no está vacío! Aquí está el código
<iframe id="this-frame"></iframe> $(function() { $("#this-frame").contents().find("body").text("iFrame Lorem ...!"); setTimeout(() => { if ($("#this-frame").contents().find("body").length) { console.log("iFrame is Empty"); } else { console.log("iFrame is not Empty"); } }, 500); });