Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do get all frames inside a iFrame in FireFox

Posted on 2007-12-05
9
Medium Priority
?
1,850 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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

916 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