Solved

How do get all frames inside a iFrame in FireFox

Posted on 2007-12-05
9
1,811 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

743 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

13 Experts available now in Live!

Get 1:1 Help Now