Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do get all frames inside a iFrame in FireFox

Posted on 2007-12-05
9
Medium Priority
?
1,843 Views
Last Modified: 2008-03-10
I have iframe, whose document has multiple frames and iframes , how can access all this frame.
frmObj.document.frames; works in i.e not Firefox.
also in i.e i can get the by frmObj.document.frames.length, how it is done in fire fox.

Note: i dont have the id's.
0
Comment
Question by:Maverick_Cool
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
9 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20409911
frmObject.frames.length and  frmObject.frames works in both
0
 
LVL 7

Author Comment

by:Maverick_Cool
ID: 20410021
No, it doesn't . i tried
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20410167
Try again. And NAME your frames in the frameset

Tested in IE6, NS 1.7.7 and FF 2.0.0.11 on windows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <title></title>
<script>
var f1 = '<iframe src="http://www.google.com/search?q=frames"></iframe><iframe src="http://www.google.com/search?q=frameset"></iframe><iframe src="http://www.google.com/search?q=iframes"></iframe>'
</script>
  </head>
<frameset rows="100%,*" onLoad="alert(top.fr1.frames.length)">
<frame name="fr1" src="javascript:top.f1">
</frameset>
</html>

Open in new window

0
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 1000 total points
ID: 20410188
frameset in iframes:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <title></title>
<script>
var f1 = '<iframe name="if1" src="about:blank"></iframe><iframe src="http://www.google.com/search?q=frameset"></iframe><iframe src="http://www.google.com/search?q=iframes"></iframe>'
var f2 = '<frameset rows="100%,*"><frame src="http://www.google.com/search?q=frames+in+iframes"></frameset>';
</script>
  </head>
<frameset rows="100%,*" onLoad="top.fr1.if1.document.write(top.f2);top.fr1.if1.close(); alert(top.fr1.frames.length); alert(top.fr1.if1.frames.length)">
<frame name="fr1" src="javascript:top.f1">
</frameset>
</html>

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20410192
Be advised that the frame whose content you want to examine must come from the same server as the script
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20882649
I would like to know what the problem is here...
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 21085533
Force accepted.
Vee_Mod
Community Support Moderator
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question