Solved

How do get all frames inside a iFrame in FireFox

Posted on 2007-12-05
9
1,816 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now