PrateekSaxena Posted April 9, 2007 Share Posted April 9, 2007 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 More sharing options...
PrateekSaxena Posted April 9, 2007 Author Share Posted April 9, 2007 now IE is also not working, it show Access Denied Link to comment Share on other sites More sharing options...
aspnetguy Posted April 9, 2007 Share Posted April 9, 2007 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 More sharing options...
PrateekSaxena Posted April 9, 2007 Author Share Posted April 9, 2007 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 More sharing options...
aspnetguy Posted April 9, 2007 Share Posted April 9, 2007 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. Link to comment Share on other sites More sharing options...
PrateekSaxena Posted April 9, 2007 Author Share Posted April 9, 2007 Alright, thanks for the info, I will try something else! Link to comment Share on other sites More sharing options...
midnite Posted January 4, 2008 Share Posted January 4, 2008 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 More sharing options...
Synook Posted January 5, 2008 Share Posted January 5, 2008 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now