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

  • Home
  • SEARCH
  • 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 7174363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:01:30+00:00 2026-05-28T16:01:30+00:00

I need to root out iframes nested within iframes nested within iframes. The structure

  • 0

I need to root out iframes nested within iframes nested within iframes.

The structure for my code is shown below. It works fine in all browsers but in ie it results in an infinite loop. However, the cpu doesn’t get raised at all while it is in the infinite loop.

var getNested_iframes = function (document_element) {
        $.each(document_element.find("iframe"), function () {
            getNested_iframes($($(this)[0].document));
        });
        alert(".");
    }
    getNested_iframes($(myWindow._element));
    alert("done");
  • 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-05-28T16:01:31+00:00Added an answer on May 28, 2026 at 4:01 pm

    I’m not quite sure why you’re doing it just like you’re doing it, but the “$($(this)[0].document)” bit looks a tch fishy to me. In any case, it’s worth noting that jquery objects are essentially lists of arbitrary size, so you can do this with iteration, rather than recursion (and swapping from recursion to iteration, when you can do it, often causes problems like this to simplify or clear up). Try the following

    $startlist = $(myWindow._element);
    
    while($startlist.length > 0)
    {
        $nextlist = $startlist.find("iframe");
        alert("(" + nextlist.length + ")");
        $startlist = $nextlist;
    }
    
    alert("done");
    

    It even lets you track how many of them are at each level, how many levels there are, and so forth.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to quickly parse out the root node of similar JSON like below:
I need to get all dlls in my application root directory. What is the
I'm hoping someone can help me out. I need to get the root web
I'm trying to accomplish a task and turns out that the code I need
Need help to figure out why the following code for basic Binary Search Tree
Using the below XML, I need to figure out which person worked more hours
I need to create an XmlDocument with a root element containing multiple namespaces. Am
I need to get the square root of a 210 digit number accurately, I
I need to add an xmlns to the root element in the output of
I need to use .gitignore to exclude a directory in the root of my

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.