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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:51:05+00:00 2026-05-30T03:51:05+00:00

Add a frame to the page Remove it Add another frame with the same

  • 0
  1. Add a frame to the page
  2. Remove it
  3. Add another frame with the same name
  4. window.frames["frame_name"] doesn’t work

HTML

<iframe id="replaceme" name="frame_1"></iframe><br />

JS

$("body").append(window.frames[0].name + "<br />");
$("body").append(window.frames["frame_1"].name + "<br />");
$("body").append( (window.frames[0] == window.frames["frame_1"]) + "<br />");

$("#replaceme").remove();

$("body").append('<iframe name="frame_1"></iframe><br />');

$("body").append(window.frames[0].name + "<br />");
$("body").append(window.frames["frame_1"].name + "<br />");
$("body").append( (window.frames[0] == window.frames["frame_1"]) + "<br />");

http://jsfiddle.net/xbmSs/

Is this a bug or expected behavior? It works fine in Opera, Safari, Chrome. Any suggestions of how to work around it in Firefox?

  • 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-30T03:51:06+00:00Added an answer on May 30, 2026 at 3:51 am

    This is a bug, as you already figured out.

    There are two options for workarounds, in addition to not reusing frame names:

    1) You could delete window.frames["frame_name"] either when removing the relevant frame from the DOM or right before you access window.frames["frame_name"]. Either one should work in Firefox, but I can’t speak to other browsers.

    2) You could switch to using document.getElementById("frame_id").contentWindow. The big problem there is IE compat, especially in older IE versions…

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

Sidebar

Related Questions

My CMDIFrameWndEx derived main frame window uses a CMFCRibbonStatusBar to which I add a
I add my page top link button like this: <a name=top></a> . . .
I have the following code for framset display <FRAMESET ROWS=18%,* > <FRAME SRC=./views/Title_Page.html NAME=TITLE
I have the following two frames frame 1 with name=top and frame 2 with
I want to add a UIView of smaller frame as subview to parental view
I'm trying to add a Row to my data.frame to spit out the average
I am new to Zend Frame Work. I am using $ajaxContext = $this->_helper->getHelper('AjaxContext'); for
How can i add an item to an existent window? I tried win.add() but
I have a web page with an applet that opens a popup window and
I'd like to add a png frame over a kwicks image slider, but when

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.