473,395 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Accessing Div in IFrame

Hi All,
I am trying to access a div in an iframe(the div is the first object within the body tag, no table, text, etc), i walked the dom tree in the "Dom Inspector" in mozilla, but cannot make sence of what javascript method to use and how to access the innerhtml of a div!.
how do i do this?, is there any tools that are freely avilable on the net to do this?
thanks all!
:D
Jan 25 '07 #1
5 4105
acoder
16,027 Expert Mod 8TB
Welcome to thescripts.

To access the innerHTML of a div, just write the following:
Expand|Select|Wrap|Line Numbers
  1. var str = document.getElementById('divid').innerHTML;
where 'divid' is the id of your div.

See this page and this one for more info. on iframes and the DOM.

If you need more help, post again.
Jan 25 '07 #2
Not realy help,
if i want to grab the innerHTML of a div on the main page, that would work, but in an iframe, it doesn't work,gotta walk the dom tree, i used document.getElementById("MyFrame").contentDocument but the problem it returns the item as a html object, what and how do i access it now? i have tried all the normal combinations with no success!, and that is for netscape, what about IE?
Jan 26 '07 #3
Hi All, got some more data,
I noticed that when i refresh/load the page, it can access the iframe's contents, and even change the bg color, but when it loads a page, it is denied access, can a page its self block access?, how could it do this?, and, is there a freeware tool that can be implemented so i can watch/track/record each action by the page being loaded into the iframe so as i can find a work around?
thanks all
Jan 26 '07 #4
when i posted the last item, i had a fair idea that it would not get answered, and would baffle most/all, but i found the answer, for all!, thanks to the kind people at Uni Massachusetts Amherst, and here it is! http://www.umass.edu/microbio/chime/pe_beta/pe/protexpl/notes/browbarr.htm

my problem is with firefox, and i believe that there are probably other security issues too.

Now to do a work-around!
Jan 26 '07 #5
when i posted the last item, i had a fair idea that it would not get answered, and would baffle most/all, but i found the answer, for all!, thanks to the kind people at Uni Massachusetts Amherst, and here it is! http://www.umass.edu/microbio/chime/pe_beta/pe/protexpl/notes/browbarr.htm

my problem is with firefox, and i believe that there are probably other security issues too.

Now to do a work-around!
If there are different servers (main page and iframe) you can't access iframe-DOM from main page and viceversa.
Jan 26 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Frédéric Mayot | last post by:
Hi, I have an HTML page like this : --- test.html <html> <body> <form> <iframe id="frametest" name="frametest" src="iframe.html"></iframe> <select multiple...
0
by: Bruce E. Pullum | last post by:
Ok, I really need some help here.... I have an ASPX page, that contains a save button. It also has an IFRAME that has a tabstrip and multipage control. What I am trying to do is to allow the...
1
by: BGMeshi | last post by:
Hi, The following javascript code (serving a main HTML page) dynamically creates IFRAME to contain other HTML page. Everyting works OK, however when I am trying to access the main HTML page...
2
by: Richie | last post by:
I have a situation where I'd like to read/parse the content of a file I've read into an <IFRAME>. I've looked through various FAQs and searched forums, and the closest I get to accessing the file...
1
by: R | last post by:
Hello, I have a frame in which there are 2 IFrames., both being loaded from the same domain. One IFrame is loaded from http://test1.xyz.com and the other IFrame is loaded from...
3
by: Greg | last post by:
Javascript Folks, I am relatively new to javascript and am working on a script where I want to utilizes a couple of iframes and format text in them. I have run into a problem with getting the...
4
by: Paul Brant | last post by:
Hi all, I have a page with an IFRAME in it. From a script in the main ( parent ) page I instruct the IFRAME to load a specific URL. The URL contains parameters that are processed by the server....
2
by: pgnPoster | last post by:
I am having the dickens of a time figuring this out. I've been googling high and low, but all the examples I find involve the iframe's src containing some HTML albeit minimal. I just want it to...
14
by: Aaron Gray | last post by:
Hi, I want to access the properties of an IFrame but seem unable to get access to the IFrames document body. <html> <body> <iframe src="test.html" id="IFrame"></iframe> </body>
4
by: maminx | last post by:
Hello..i have problem, hope someone can help me..i have this frameset below : <FRAMESET ROWS="55%" COLS="37%,63%"> <FRAME NAME="runningTrade" SRC="http://runningtrade.com" scrolling="no"> ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.