473,396 Members | 1,771 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,396 software developers and data experts.

Interacting with IFRAME contents

I'm using IFRAME to connect back to my ASP.NET page in order to fetch
the FreeBox HTML Editor html contents and scripts (i do this apprach
because the html editor is fairly heafty to send to the user when most
dont use it on our site instead deferring to a user request before
actually sending down the code via AJAX or in this case an IFRAME).
>From there I plan on scraping the IFRAME via Javascript to gather then
append all script tags and relevant html elements into my main page's
DOM, outside of the iframe.

I've used iframe.contentDocument() and then myiframedoc.body.innerHTML
and getElementsByTagName("head")[0] / ("body")[0] to extract the
contents from the iframe. I am able to see the code and nodes and even
append it to my main page (ie. add <scriptnodes from the iframe into
my main page's head area). For the most part nothing happens. I was
expecting the downloaded IFRAME contents (which is hidden from view)
would visibly appear in my main page. This is not the case. Nothing
happens at all. It's as if FF and IE refuse to kickstart their
rendering engines to visually acknowledge the new nodes. Weird.

At times I have spotted IE even making the attempt to redload a <script
srcelement once it has been newly added to my main page. It
downloads fine but again nothing happens. I try to access declared
variables within the script block and only get back Undefined. Im
still gathering the details but it seems like all script blocks and
<linkelements are the problems between the iframe and my main js app.

Can someone please tell me how Im going about accessing the DOM
incorrectly?

Thank you.

Dec 11 '06 #1
2 2419
ASM
bs****@gmail.com a écrit :
>
Can someone please tell me how Im going about accessing the DOM
incorrectly?
I think your browsers believe you are trying to do cross-domain
(that is not tolerated) and it is exactly what you do :
domain of FreeBox <-localhost
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Dec 11 '06 #2
No, this is all done on my own server. Im aware of cross domain
restrictions and this is not the case as alreadt mentioned
ASM wrote:
bs****@gmail.com a écrit :

Can someone please tell me how Im going about accessing the DOM
incorrectly?

I think your browsers believe you are trying to do cross-domain
(that is not tolerated) and it is exactly what you do :
domain of FreeBox <-localhost
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Dec 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff Thies | last post by:
I'm (still) having trouble reading the contents of an IFRAME (IE5). I have this: var my_iframe = document.frames; What I would want to do at that point is get either the...
3
by: John Chen | last post by:
I need to use iframe to create a floating frame. But the contents in the iframe is not a external html file. Rather, it will be dynamically created by jsp. How can I set the src attribute to a URL...
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>
3
by: David Virgil Hobbs | last post by:
I discovered how to write out the inner HTML of the contents of an Iframe; I want to know how to write out the outerHTML of the contents of an Iframe. frames.document.body.innerHTML allows me to...
1
by: jaktharkhan | last post by:
Hi, I really really need help in trying to figure out how can I do a CloneNode on an Iframe where the cloned IFRAME clones with all its contents?. Basically what I am doing is dynamically building...
7
by: Tom Cole | last post by:
IFrames have been used by years for people to accomplish many of the tasks the XMLHttpRequest does for them now...I unfortunately am late in the game and XMLHttpRequest was already out there by the...
1
by: rissaofthesaiyajin | last post by:
I have a page with an iframe, and a Javascript function that I need to get the contents of the iframe - what I mean by that is, the text from the list.html file that's in the iframe. It's actually a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.