Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot drop IFRAME content into DIV
Message
De
25/08/2009 17:26:54
 
 
À
Tous
Information générale
Forum:
Internet
Catégorie:
Javascript
Titre:
Cannot drop IFRAME content into DIV
Divers
Thread ID:
01420609
Message ID:
01420609
Vues:
84
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform