Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot drop IFRAME content into DIV
Message
From
25/08/2009 17:26:54
 
 
To
All
General information
Forum:
Internet
Category:
Javascript
Title:
Cannot drop IFRAME content into DIV
Miscellaneous
Thread ID:
01420609
Message ID:
01420609
Views:
85
I have this simple javascript:
function DisplayExternal()
{
    lcDiv = document.getElementById("display")
    lcIFrame = window.frames["buffer"].document.body.innerHTML
    alert("Start")
    alert(lcIFrame)
    alert(lcDiv.innerHTML)
    lcDiv.innerHTML = "1"
    alert(lcDiv.innerHTML)
    lcDiv.innerHTML = lcIFrame
    alert(lcDiv.innerHTML)
}
The goal is to drop the IFRAME content into a DIV. The first alert shows "Start". Then, it shows the content of the IFRAME. The 3rd alert shows an empty message box as the DIV doesn't content anything yet. Then, I put "1" in it. So, the next display shows "1". So, all this shows that I have some content in the IFRAME and that I can initialize the DIV content. However, before the last line, I am trying to initialize the DIV content with the lcIFrame variable, which we know its content as the alert is showing it. However, that line cannot be executed. It gives a javascript error. I just cannot understand why I cannot assign lcIFrame to the DIV as is.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform