Jump to content

iFrame innerHTML


PrateekSaxena

Recommended Posts

Hi,I am trying to get the innerHTML of an iFrame. But when I alert the iFrameId.innerHTML then I am able to see the result on IE 6.0 but not on FF 2.0.0.3. do you have any idea why this is happening?

Link to comment
Share on other sites

now IE is also not working, it show Access Denied

Link to comment
Share on other sites

var html = document.frames['iframeName'].document.body.innerHTML

should work in all browsers.But it only works on pages in the same domain. You cannot load Google for example and get the innerHTML. This is a security measure of all browsers.

Link to comment
Share on other sites

Cant I change it for some time. I mean this setting.How do I do it for FF, I figured out for IE

Link to comment
Share on other sites

Alright, thanks for the info, I will try something else!

Link to comment
Share on other sites

  • 8 months later...
nope it is hard coded into every browser. If you could do this you could change anything about the site and fool people into giving to information, etc.
can i access the DOM tree (or raw html) in a frame (not iframe)? i mean i just want to get information from the remote sites, not changing (not it's nothing different, i guess)
Link to comment
Share on other sites

Use a server side language (e.g. file_get_contents() in PHP). You could use that in conjunction with AJAX to call a page via JavaScript.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...