Solved

How do get all frames inside a iFrame in FireFox

Posted on 2007-12-05
9
1,830 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 250 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
Suggested Courses

615 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