Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
Not Able to Check if Iframe is Empty or not

Can you please take a look at This Pen and let me know why I am getting wrong output ("iFrame is Empty") while the #this-frame is already populated with

$("#this-frame").contents().find("body").text("iFrame Lorem ...!");

and is not empty! Here is the code

<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);

});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!