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 164923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:49:49+00:00 2026-05-11T11:49:49+00:00

This is the iframe I’m trying to access: <div class=mceBody id=additionalTxt_b> <iframe frameborder=0 id=additionalTxt_f

  • 0

This is the iframe I’m trying to access:

 <div class='mceBody' id='additionalTxt_b'>         <iframe frameborder='0' id='additionalTxt_f' src='javascript:''' class='punymce'/>  </div> 

Using this line:

frames['additionalTxt_f'].document.getElementsByTagName('body')[0].innerHTML 

For some reason I’m getting ‘frames.additionalTxt_f is undefined’ from firebug. I have similar iframes (dynamically created by punyMCE plugin) on other pages, and they work perfectly fine. And IE7/8 has no problem accessing this iframe either.

Just at a complete loss here. Any ideas on why Firefox can’t find the iframe?

  • 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. 2026-05-11T11:49:49+00:00Added an answer on May 11, 2026 at 11:49 am

    The window.frames[] array is indexed by the [i]frame’s name attribute (aka frame target). id can’t be relied upon to also work — although it may in IE <8, which often thinks names and ids are the same thing.

    If you want to access a frame’s content via ID, use the DOM Level 2 HTML contentDocument property instead of the old-school (“DOM Level 0”) frames array:

    document.getElementById('additionalTxt_f').contentDocument.body.innerHTML 

    …but then, for compatibility with IE <8, you also have to add some fallback cruft, since it doesn’t support contentDocument:

    var f= document.getElementById('additionalTxt_f'); var d= f.contentDocument? f.contentDocument : f.contentWindow.document; d.body.innerHTML 

    So it’s up to you which method you think is less ugly: the extra script work, or just using the name attribute.

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

Sidebar

Related Questions

I have this iFrame in my parent window... <iFrame src=http://theirdomain.com id=Post_iFrame></iFrame> Then I have
I have an iframe window that displays a report. To access this iframe, I
I have applied this code for iframe id. <iframe id='<?php echo 'fraDisabled'.$i.$post->ID; ?>' src='<?php
i use javascript to judge a page is in a iframe: if (this !=
I'm passing a varaible to a iframe but can't seem to access this variable
How do I clear the content of my IFRAME element, using javascript, without loading
I have an ifram on a page with class ms-dlgFrame and in this iframe
I'm completely new to using jQuery. Why isn't this working? <iframe width=800 scrolling=no id=prev
I'm trying to add this iframe to my Aspx page and I'm trying to
I have the following code to set the src of an iFrame alert(this.options.url); this.iframe.src

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.