Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8572235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:57:48+00:00 2026-06-11T18:57:48+00:00

I have seen some articles about accessing the data inside the iframe,So i have

  • 0

I have seen some articles about accessing the data inside the iframe,So i have in the page that is loading in the iframe a table like this: <table class="table">...</table>

so all i want to be displayed in that iframe is this table, without any headers or other divs or anything

How can i do this with jQuery ?

UPDATE:

the html code looks like this: i added the table inside a <div>

<div id="test">
<br>
<table class="table">
<thead>
<tr>
<th> ...... // and so on

SO, all i want to be displayed in that iframe is this div

UPDATE for Adil:

$(window).load(function () {
        var filteredContents = $('.test').contents().find('.div_iframe').html();
        $('.test').contents().find('body').html(filteredContents);
});

HTML looks like this:

<iframe class="test" width="100%" height="100%" src="/message.html?msjId=268" style="height:100%;width:100%;">
<iframe class="test" width="100%" height="100%" src="/message.html?msjId=260" style="height:100%;width:100%;">

and the tables that should be displayed now, they should be two different tables, but at the moment is the same table for both msjId but duplicated from the first msjId…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:57:49+00:00Added an answer on June 11, 2026 at 6:57 pm

    You have to use jquery load method instead of ready. As load makes sure that the iFrame html is loaded. On the other hand ready makes sure the html elements in the current page are ready.

    $(window).load(function () {  
          var filteredContents = $('#iframeId').contents().find('.table').html();
          $('#iframeId').contents().find('body').html(filteredContents);
    });
    

    Update based on OP request.

    When you have two elements you can use ids instead of class, Please read about selectors

    <iframe id="frame1" width="100%" height="100%" src="/message.html?msjId=268" style="height:100%;width:100%;">
    <iframe id="frame2" width="100%" height="100%" src="/message.html?msjId=260" style="height:100%;width:100%;">
    
     $(window).load(function () {
         var filteredContents1 = $('#frame1').contents().find('.div_iframe').html();
         $('#frame1').contents().find('body').html(filteredContents1);
    
         var filteredContents2 = $('#frame2').contents().find('.div_iframe').html();
         $('#frame2').contents().find('body').html(filteredContents2);
    
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen some articles about HTML5 Manifest, which say that we must add
So I have seen other articles here on stack about this and a lot
I have seen some people in SO commenting that Singleton Pattern is an anti-pattern.
I have seen some of the other answers on this topic but dont really
I have seen some demos about the jQuery wizard plugin on websites. But all
I'm just curious about Domain-Specific Languages. I have seen them several times in articles,
I have seen some articles on provider patten. I have a little idea of
After reading this article about validating with service layer I have some doubts. First:
I have seen some examples that show that Firefox supports some kind of JavaScript
Have seen some similar questions: What is the difference between a JavaBean and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.